#include<bits/stdc++.h> using namespace std; bool check(int n){ int len=to_string(n).size(); int tmp=n; set<int> st; while(tmp>0){ int m=tmp%10; if(m>len-1){ return false; } st.insert(m); tmp/=10; } if(st.size()!=len){ return false; } return true; } int main(){ int a,b; scanf("%d%d",&a,&b); int cnt=0; if(a<10) a=10; for(int i=a;i<=b;i++){ if(check(i)){ cnt++; } } printf("%d",cnt); return 0; }