#include<bits/stdc++.h>//submitRecord//
using namespace std;
//const int N=1e7+10;
int main(){
//freopen("","r",stdin);
//freopen("","w",stdout);
ios::sync_with_stdio();
cin.tie(nullptr);
cout.tie(nullptr);
int a,b;
cin>>a>>b;
if(a<60 && b<60) cout<<0;
else if(a<60 || b<60) cout<<1;
else cout<<0;
//fclose(stdin);
//fclose(stdout);
return 0;
}