def f(x): if x < 296: return 0 elif x < 417: return 1 else: return 2 x,y = map(int,input().split()) print(f(y)-f(x))