a,b=map(int,input().split()) print(3-len(list(range(23,b+1))))