#include<bits/stdc++.h> using namespace std; int cnt[15]; int main() { int a,b,ans=0; scanf("%d%d",&a,&b); for(int i=a;i<=b;i++){ memset(cnt,0,sizeof cnt); int t=i,ok=1,maxn=-1; while(t){ cnt[t%10]++; maxn=max(maxn,t%10); if(cnt[t%10]>1){ ok=0; break; } t/=10; } for(int i=0;i<=maxn;i++){ if(!cnt[i]){ ok=0; break; } } ans+=ok; } printf("%d",ans); return 0; }