M, D = map(int, input().split()) print(23 + ((M, D) >= (8, 22)))