a, b = map(int, input().split()) l = [22, 23, 24] for i in range(a, b): if i in l: l.remove(i) print(len(l))