#include using namespace std; int main() { int A, B; cin >> A >> B; double b = B * 360 / 60; double a = A % 12 * 360 / 12 + b / 12; double d = a - b; if( d < 0 ) d = 360 + d; double l = (double)360 / 60 / 60; double s = (double)360 / 12 / 60 / 60; double p = l - s; double sec = d / p; printf( "%.0lf\n", sec ); }