#include <bits/stdc++.h> using namespace std; bool ff[10]; bool f(int n) { int w = 0, c = n; while (c) c /= 10, w++; for (int i = 0; i < w; i++) ff[i] = 0; while (n) { ff[n % 10]++; n /= 10; } for (int i = 0; i < w; i++) if (!ff[i]) return 0; return 1; } int main() { int a, b, ans = 0; cin >> a >> b; for (int i = a; i <= b; i++) ans += f(i); cout << ans; return 0; }