#include<bits/stdc++.h> using namespace std; long long cnt; bool p(long long x) { bool k[]={0,0,0,0,0,0,0}; long long w=0; while(x!=0) { w++; k[x%10]=1; x=x/10; } for(long long i=0;i<w;i++) { if(k[i]==0) return false; } return true; } int main() { freopen("p1.in","r",stdin); freopen("p1.out","w",stdout); long long a,b; cin>>a>>b; for(long long i=a;i<=b;i++) { if(p(i)) cnt++; } cout<<cnt<<endl; return 0; }