#include<iostream>
#include "iomanip"
#include<cmath>
using namespace std;
int main()
{
int n,x,r=0;
cin>>n>>x;
for(int i = n;i<=x;i++)
{
if(i%10==2)
{
r++;
}
if(i/10%10==2)
{
r++;
}
if(i/100%10==2)
{
r++;
}
}
cout<<r;
return 0;
}
#1和#2是AC其他都不对求大佬指点,见笑了!!?