#include <bits/stdc++.h> using namespace std; int n,m,sz[102],a=0,t,w,ans; int main(){ cin>>n>>m; for(int i=n;i<=m;i++){ t=i;a=0;w=1; while(t){ sz[a]=t%10; t/=10; a++; } sort(sz,sz+a); for(int j=0;j<a;j++){ if(sz[j]!=j){ w=0; } } if(w==1)ans++; } cout<<ans; return 0; }