#include using namespace std; #define rep(i,n) for(int i = 0; i < (n);i++) #define sz(x) int(x.size()) typedef long long ll; typedef long double ld; typedef pair P; constexpr int mod = 1e9+7; int main() { int a, b; cin >> a >> b; a = a * 3600 + b * 60; int c = a % 3600*12; int d = a % (12 * 3600); if (c == d) { cout << 0 << endl; return 0; } d -= c; if (d < 0) d += 12 * 3600; cout << d / 11 << endl; return 0; }