l,r = map(int,input().split()) ans = 0 if l <= 295 <= r and l <= 296 <= r: ans += 1 if l <= 416 <= r and l <= 417 <= r: ans += 1 print(ans)