#include<bits/stdc++.h> using namespace std; int main() { int l,r,w=0,s=0;scanf("%d%d",&l,&r); for(int i=l;i<=r;i++){ w = i; while(w!=0) { if (i%10==2) s++; w = w/10; } } printf("%d",s); return 0; }