import sys from collections import deque, defaultdict,Counter from copy import deepcopy from bisect import bisect_left, bisect_right, insort_left, insort_right from heapq import heapify, heappop, heappush from itertools import product, permutations, combinations, combinations_with_replacement,accumulate from functools import reduce from math import gcd, sin, cos, tan, asin, acos, atan, degrees, radians, ceil, floor, log, sqrt, ceil, floor, pi, hypot from string import ascii_lowercase from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN sys.setrecursionlimit(1000000) INF = 10**12 MOD = 10**9+7 # MOD = 998244353 yes="Yes" no="No" #| from random import randint def II():return int(input()) def SI():return str(input()) def MI():return map(int,input().split()) def MS():return map(str,input().split()) def LI():return list(map(int,input().split())) def SLI():return sorted(list(map(int,input().split()))) def LS():return list(map(str,input().split())) n=int(input()) cnt=0 lis=[] for i in range(1,n): if ((n**2 - i**2)**.5)**2 == int((n**2 - i**2)**.5)**2: cnt+=1 print(cnt)