#include <iostream> #include <cmath> #include <string.h> using namespace std; int a, b; string t; int cnt; int temp; int main() { cin >> a >> b; for (int j = a; j <= b; j++) { t = '\0'; int s = j; for (int i = 0; i < 7; i++) { if (s >= pow(10, i)) continue; else { temp = i - 1; break; } } for (int i = temp; i >= 0; i--) { t[i] = s % 10 + '0'; s /= 10; } if (t[0] == '0') continue; else { int n[7] = {0,0,0,0,0,0,0}; for (int i = 0; i < t.size(); i++) { n[t[i]-'0']++; } bool y = true; for (int i = 0; i < t.size(); i++) { if (n[i] != 1) y = false; } if (y) cnt++; } } cout << cnt; return 0; }