#include<bits/stdc++.h> using namespace std; bool check(int x) { bool flag[x+10]; int xc = x,n = 0; while(x){ x /= 10; n++; } for(int i=0;i<n;i++){ flag[i] = false; } while (xc) { int t = xc%10; flag[t] = true; xc /= 10; } for(int i=0;i<n;i++) { if(flag[i]==false) return false; } return true; } int main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int a,b,ans = 0; cin >> a >> b; for(int i=a;i<=b;i++) { if(check(i)) ans++; } cout << ans; return 0; }