#include<bits/stdc++.h> using namespace std; int h[10]; bool check(int n){ memset(h,0,sizeof(h)); int t=n; int tot=0; while(t!=0){ t/=10; tot++; } int q=n; while(q!=0){ int w=q%10; q/=10; if(w>=tot||h[w]==1) return 0; h[w]=1; } return 1; } int main(){ ios::sync_with_stdio(0); cin.tie(0);cout.tie(0); int a,b; cin>>a>>b; int ans=0; for(int i=a;i<=b;i++){ if(check(i)){ // cout<<i<<endl; ans++; } } cout<<ans<<endl; return 0; }