#include <bits/stdc++.h> using namespace std; int l,r,t=0,ans; int main() { cin>>l>>r; for (int i=l; i<=r; i++) { ans=i; while (ans!=0) { if (ans%10==2)t++; ans=ans/10; } } cout<<t; return 0; }