#include <bits/stdc++.h> using namespace std; int a,b,cnt; bool check(string s,int w) { bool f[15]; memset(f,false,sizeof(f)); for(int i = 0 ; i < s.size() ; i++) { f[s[i] - '0'] = true; if(s[i] - '0' > w) return false; } for(int i = 0 ; i <= w ; i++) { if(!f[i]) return false; } return true; } int main() { cin >> a >> b; for(int i = a ; i <= b ; i++) { if(check(to_string(i),to_string(i).size() - 1)) cnt++; } cout << cnt; return 0; }