#include <bits/stdc++.h> using namespace std; int ans,a,b; bool check(int n){ int b=n,ws=0; while(b){ ws++; b/=10; } ws--; int bb[9]; memset(bb,false,sizeof(bb)); while(n){ bb[n%10]=true; n/=10; } for(int i=0;i<=ws;i++){ if(bb[i]==0)return false; } return true; } int main() { cin>>a>>b; for(int i=a;i<=b;i++){ if(check(i))ans++; } cout<<ans; return 0; }