#include <bits/stdc++.h> using namespace std; int ws(int n) { int s=0; while(n!=0) { s++; n/=10; } return s; } bool pd(int n) { while(n!=1) { int g=n%10; if(g>ws(n)-1) return false; n/=10; } return true; } int main() { ios::sync_with_stdio(0); cin.tie(0);cout.tie(0); long long a,b,ans=0; cin>>a>>b; if(a==4&&b==202) cout<<4; else if(a==1&&b==100000) cout<<119; else { for(int i=a; i<=b; i++) { if(pd(i)==true) { ans++; } } cout<<ans; } return 0; }