#include using namespace std; int main() { long long A, B; cin >> A >> B; long long c = (long long)360 * 60 * 60 * 12; long long b = B * c / 60; long long a = A % 12 * c / 12 + b / 12; int ans = 0; while( abs( a - b ) > 2000 && ans < 1900 ) { b += c / 60 / 60; if( b > c ) b -= c; a += c / 12 / 60 / 60; if( a > c ) a -= c; ans++; } cout << ans << endl; }