#include<bits/stdc++.h> using namespace std; int weishu(int x){ int n=0; while(x!=0){ x/=10; n++; } return n; } bool zhaoshu(int n,int x){ while(n!=0){ int y=n%10; if(x==y) return true; n/=10; } return false; } int main(){ int n,m,x=0; cin>>n>>m; bool o=true; for(int i=n;i<=m;i++){ int a=weishu(i); for(int j=0;j<a;j++){ if(!(zhaoshu(i,j))) o=false; } if(o) x++; o=true; } cout<<x; return 0; }