#include<bits/stdc++.h> using namespace std; bool check(int x) { int cnt[10]={},w=0; while(x>0) { w++; cnt[x%10]++; x/=10; } for(int i=0;i<w;i++) if(cnt[i]==0) return 0; for(int i=w;i<=7;i++) if(cnt[i]>=1) return 0; return 1; } int main() { int a,b,cnt=0; cin>>a>>b; for(int i=a;i<=b;i++) if(check(i)) cnt++; cout<<cnt; return 0; }