l=gets.to_i/8 z=0 (1..l**0.5).map{|m| (1...m).map{|n| z+=1 if m-n&1==1 && m*m+m*n<=l && m.gcd(n)==1 } } p z