#include<bits/stdc++.h> using namespace std; int a,b,g; int main(){ cin>>a>>b; for(int q=a;q<=b;q++){ int x=q,m[15],t=0,f=1; memset(m,0,sizeof(m)); while(x){ m[x%10]++; t++; x/=10; } for(int i=0;i<t;i++) if(m[i]!=1) f=0; g+=(f?1:0); } cout<<g; return 0; }