#include<bits/stdc++.h> using namespace std; int a[10]; bool pd(int n) { if(n<10) { return false; } memset(a,0,sizeof(a)); int r=n;int ws=0; while(r!=0) { int g=r%10; a[g]++; r/=10; ws++; } for(int i=0;i<=ws-1;i++) { if(a[i]!=1) { return false; } } return true; } int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int a,b; cin>>a>>b; int cnt=0; for(int i=a;i<=b;i++) { if(pd(i)) { cnt++; } } cout<<cnt; return 0; }