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)