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