l, r = gets.not_nil!.split.map(&.to_i) ans = 0 if l <= 295 && r >= 296 ans += 1 end if l <= 416 && r >= 417 ans += 1 end puts ans