#include<bits/stdc++.h> using namespace std; int a, b, ans; bool check(string x){ sort(x.begin(), x.end()); for(int i = 0;i < x.size();i++) if(x[i] - '0' != i) return 0; return 1; } int main(){ cin>>a>>b; for(int i = a;i <= b;i++) if(check(to_string(i))) ans++; cout<<ans; }