#include<bits/stdc++.h> using namespace std; int main(){ int n,m,a[110],sj=0,g=0,gs=0,s,b=0; cin>>n>>m; for(int i=n;i<=m;i++){ s=i; for(int j=1;j<=8;j++){ g++; a[j]=s%10; s/=10; if(s<=0){ break; } } for(int j=1;j<=g;j++){ for(int l=1;l<=g;l++){ if(a[l]>a[j]){ swap(a[l],a[j]); } } } for(int j=1;j<=g;j++){ if(a[j]==b){ gs++; } b++; } if(gs==g){ sj++; } g=0; gs=0; b=0; } cout<<sj; return 0; }