a, b = map(int, input().split()) x = [i for i in range(a, b+1)] y = [23, 24, 25] print(3 - len(set(x) & set(y)))