public class Main {
public static void main(String[] args) {
int cnt=0;
for(int year=1900;year<=9999;year++)
{
int[] days= {31,28,31,30,31,30,31,31,30,31,30,31};
if(year%4==0 && year%100!=0 || year%400==0)
{
days[1]=29;
}
for(int month=1;month<=12;month++)
{
for(int day=1;day<=days[month-1];day++)
{
if(String.valueOf(year).contains("2")||String.valueOf(month).contains("2")||String.valueOf(day).contains("2"))
{
cnt++;
}
}
}
}
System.out.println(cnt);
}
}