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