#include<bits/stdc++.h> using namespace std; #define int long long int a[10]={0,1,2,3,4,5,6,7,8,9},b[10]; int n,m,cnt; signed main(){ ios::sync_with_stdio(false); cin.tie();cout.tie(); cin>>n>>m; for(int i=n;i<=m;i++){ int t=-1,f=1; b[10]={}; while(n){ t++,b[t]=n%10; n/=10; } sort(b,b+t); for(int i=1;i<=t;i++){ if(b[i]!=a[i]){ f=0; break; } } if(f==1) cnt++; } cout<<cnt; }