#include using namespace std; int main(){ int a,b,c; cin >> a >> b >> c; if(a*60 < b) cout << -1 << endl; else cout << (60*a + b + 60*60*c) / (a*60) << endl; }