#include <bits/stdc++.h> using namespace std; string strs[10] = {"", "0", "01", "012", "0123", "01234", "012345", "0123456", "01234567", "012345678"}; int main(){ int l, r, cnt = 0; cin >> l >> r; for(int i = 1;i < 10;i++){ do{ if(stoi(strs[i]) >= l && stoi(strs[i]) <= r && to_string(stoi(strs[i])) == strs[i]) cnt++; } while(next_permutation(strs[i].begin(), strs[i].end())); } cout << cnt << "\n"; return 0; }