#include<iostream.h>
int d,m,y;
void main()
{ cin>>d>>m>>y;
for (int j=0;j<=1;j++)
if ((d>31)||(m>12)||(y<1980)||(y>2099)) braek; 
else cout<<3;
}