#include<iostream> using namespace std; int main() { int i,a,b,s=0; cin>>a>>b; for(i = a;i<=b;i++) { int k=i; while(k>0) { int g =k%10; if(g==2) s++; k=k/10; } } cout<<s; return 0; }