#include<bits/stdc++.h> using namespace std; int a, b, ans; bool check(int x){ int num = 0; int p[10] = {0}; while(x > 0){ int t = x % 10; p[t]++; x /= 10; num++; } for(int i = 0;i < num;i++){ if(p[i] != 1) return false; } return true; } int main(){ cin >> a >> b; for(int i = a;i <= b;i++){ if(check(i)){ ans++; } } cout << ans << "\n"; return 0; }