n = list(map(int,input().split())) l = list(range(n[0],n[1]+1)) s = [23,24,25] And = len(list(set(l) & set(s))) ans = 3 - And print(ans)