#include<bits/stdc++.h> using namespace std; int b[1000005]; bool check(int a) { int w=0,t=a; while(t!=0) { w++; t/=10; } for(int i=1;i<=w;i++) { b[i]=i-1; } for(int i=1;i<=w;i++) { int t1=a,f=0; for(int j=1;j<=w;j++) { if(b[i]==t1%10) { f=1; break; } t1/=10; } if(f==0) { return false; } } return true; } int main() { ios::sync_with_stdio(0); cin.tie(0);cout.tie(0); int n,m,s=0; cin>>n>>m; for(int i=n;i<=m;i++) { if(check(i)) { s++; } } cout<<s; return 0; }