#include<bits/stdc++.h> using namespace std; int a,b,s[10],cnt; int xing(int n){ int ret = 0,i = 0; while(n>0){ s[i] = n%10; n = n/10; i++; } sort(s,s+i); for(int j = 0;j<i;j++){ if(s[j]!=j){ return 0; } } return 1; } int main(){ cin>>a>>b; for(int i = a;i<=b;i++){ memset(s,0,sizeof(0)); if(xing(i))cnt++; } cout<<cnt; return 0; }