#include using namespace std; template void cmin(T &a, U b) { if (a > b) a = b; } template void cmax(T &a, U b) { if (a < b) a = b; } int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); int A, B; cin >> A >> B; if (A >= 12) A -= 12; long double H = 360 / 12 * A + 360.0 / 12 / 60 * B; long double M = 360 / 60 * B; if (H < M) H += 360.0; cout << floor((H - M) / 5.5 * 60) << "\n"; }