#include<bits/stdc++.h> using namespace std; int s=0; string str; int a,b; //fjj ywc 100 p1 d1 int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin>>a>>b; for(int i=a;i<=b;++i) { str=to_string(i); // cout<<i<<" "<<s<<endl; bool flag=true; bool f[str.size()+1]={false}; f[str.size()]=true; for(int j=0;j<str.size();++j) { if(str[j]-'0'>=str.size()||str[0]==0) { f[str.size()+1]=false; //cout<<flag<<endl; } f[str[j]-'0']=true; } for(int j=0;j<str.size()+1;++j) { if(f[j]==false) { flag=false; } } if(flag) { ++s; //cout<<str<<endl; //cout<<s; } } cout<<s<<endl; return 0; }