func main() var n: int :: cui@inputInt() var primes: []int :: #[n]int do primes[0] :: 2 var primesNum: int :: 1 for i(3, n, 2) for j(0, primesNum - 1) var prime: int :: primes[j] if(prime ^ 2 > i) break j end if if(i % prime = 0) skip i end if end for do primes[primesNum] :: i do primesNum :+ 1 end for var ans: int :: 0 for i(0, primesNum - 1) var r: int :: primes[i] if(r * r > 2 * n) break i end if for j(0, primesNum - 1) var p: int :: primes[j] var q: int :: r * r - p if(0 < q & q <= n & math@prime(q)) do ans :+ 1 end if end for end for do cui@print("\{ans}\n") end func