#include <bits/stdc++.h> #define int long long using namespace std; int temp[15]; bool check(int n) { memset(temp, 0, sizeof temp); int s = 0; while (n) { int k = n % 10; temp[k] = 1; n /= 10; s++; } int cnt = 0; for (int i = 0; i < s; i++) { cnt += temp[i]; } return cnt == s; } signed main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int a, b; cin >> a >> b; int ans = 0; for (int i = a; i <= b; i++) { ans += check(i); } cout << ans; return 0; }