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