#include<bits/stdc++.h> using namespace std; typedef long long ll; int l,r,ans; bool check(int x){ int n=0,t[10]={0}; while(x>0){ t[x%10]++; x/=10; n++; } for(int i=0;i<9;i++){ if((i<n&&t[i]!=1)||(i>=n&&t[i]>0)){ return false; } } return true; } int main(){ cin>>l>>r; for(int i=l;i<=r;i++){ if(check(i)){ ans++; } } cout<<ans; return 0; }