#include <ctime>
using namespace std;
int main()
{
time_t timer;
struct tm* t_tm;
time(&timer);
t_tm=localtime(&timer);
int year=t_tm->tm_year+1900,
month=t_tm->tm_mon+1,
day=t_tm->tm_mday;
int y,m,d;
cin>>y>>m>>d;
if(month<m||month==m&&day<d) cout<<year-y-1<<endl;
else cout<<year-y<<endl;
return 0;
}