#include<bits/stdc++.h> using namespace std; int main(){ double a,b,c; cin>>a>>b; for(int i=1;i<=b+1;i++){ if (i>=a&(i%10==2||floor(i/10)==2))c++; if (i>=a&(i%10==2&floor(i/10)==2))c++; } cout<<c; return 0; }