#include<bits/stdc++.h> using namespace std; int a,b,ci,l=0; bool f; int main(){ cin>>a>>b; for(int i=a;i<=b;i++){ int t[10]={},k=0; ci=i; while(ci){ t[ci%10]++; k++; ci/=10; } f=1; for(int i=0;i<k;i++){ if(t[i]!=1){ f=0; break; } } l+=f; } cout<<l; return 0; }