#include<bits/stdc++.h>; using namespace std; int main(){ int c,m; cin>>c>>m; if(c<60||m<60){ cout<<"1"; }else{ cout<<"0"; }return 0; }