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