Jimp Numbers

등차수열을 이루는 양의 정수 (a, b, c)에 대해 a^2 + b^2 + k = c^2을 만족하는 삼중항이 정확히 하나 존재하는 k의 개수를 n 이하에서 센다.

어려움9정수론수학조합론완전 탐색아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

A positive integer k is called a jimp number if there is exactly one triple of positive integers (a, b, c) such that a, b, and c are consecutive terms of an arithmetic progression (exactly in that order) and a2 + b2 + k = c2.

Count the jimp numbers which are not greater than the given number n.

입력

The only line contains a single integer n (1 ≤ n ≤ 1011).

출력

Print a single integer: the answer to the problem.