#include<bits/stdc++.h> using namespace std; #define int long long int a, b, ans; bool vst[15]; signed main(){ cin >> a >> b; for(int i = a; i <= b; i++){ int s = i, cnt = 0, maxn = 0; bool f = true; memset(vst, false, sizeof(vst)); while(s){ int num = s % 10; s /= 10; cnt++; maxn = max(maxn, num); if(vst[num]){ f = false; break; } vst[num] = true; } if(f && maxn < cnt){ ans++; } } cout << ans; return 0; }