a, b = map(int, input().split()) t = (a % 12 * 60 + b) * 60 * 11 x = 0 while x < t: x += 43200 print((x - t) // 11)