def main(): i = input() lst = i.split(' ') A,B = int(lst[0]),int(lst[1]) if A < 23 and 25 < B: print(0) if A < 23 and 22 < B < 26: print(25-B) if A < 23 and B < 23: print (3) if 22 < A < 26 and B < 26: print (25-A) if 26 < A : print(3) if __name__ == '__main__': main()