#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { int i, j, k; long long a, b, c; cin >> a >> b >> c; a *= 60; c *= 3600; if (a <= b) { cout << -1 << endl; //getchar(); //getchar(); return 0; } long long x; long long sa = a - b; x = c / a; long long yo = c % a; long long ama = x * b; x = x + (x / sa); c += (x / sa) * b; c += ama; while(true){ //if (c <= a*x) { if (c >= a*x) { c += b; x++; } else { break; } } /* long long num = 0; while (true) { if (yo > b * num) { num++; } else { break; } } */ //cout << x + num << endl; cout << x << endl; getchar(); getchar(); return 0; }