using namespace std; int main() {
int l,r; int s=0; cin>>l>>r; for(int i=l;i<=r;i++) { int q=i; while(q) { if(q%10==2) s++; q/=10; } } cout<<s;
}