L, R = map(int, input().split()) ans = 0 for i in range(L+1,R+1): if i == 296 or i == 417: ans += 1 print(ans)