m, d = io.read("*n", "*n") f = 23 if m < 8 then elseif m == 8 then f = 21 < d and 24 or 23 else f = 24 end print(f)