#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define N (1000000000+7) //#define N 998244353 #define INF 1e16 typedef long long ll; typedef pair P; const int inf = 1e8; int main() { ll a,b,c; cin>>a>>b>>c; if(60*a-b<=0)cout<<-1<