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