#include<bits/stdc++.h> using namespace std; int a,b,t[10],ans = 0; bool is(int i){ memset(t,0,sizeof(t)); int n = 0; while(i){ t[i % 10]++; n++;i /= 10; } for(int i = 0;i < n;i++) if(!t[i]) return false; return true; } int main(){ cin >> a >> b; for(int i = a;i <= b;i++) if(is(i)) ans++; cout << ans << endl; return 0; }