#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define rep(i, n) for(int i = 0; i < n; i++) #define per(i, n) for(int i = n - 1; i >= 0; i--) using ll = long long; #define vi vector #define vvi vector #define vl vector #define pii pair #define pll pair #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() #define mod 1000000007 using namespace std; int main(){ int a,b; cin >> a >> b; a %= 12; double hours = 30 * a + 0.5 * b; double minutes = 6 * b; double diff = hours - minutes; if(diff < 0) diff += 360; double ans = diff * 60 / 5.5; cout << (int)ans << "\n"; }