L,R = map(int, input().split()) s = set() for i in range(L,R+1): if 1<=i<296: s.add("a") elif 296<=i<417: s.add("b") else: s.add("c") print(len(s)-1)