import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.LinkedList; import java.util.Scanner; import java.util.Set; import java.util.TreeSet; public class Main { public static long gcd(long a, long b){ return b == 0 ? a : gcd(b, a % b); } public static void main(String[] args){ Scanner sc = new Scanner(System.in); final long L = sc.nextLong(); int count = 0; LOOP: for(int m = 1; m < 10000; m++){ for(int n = m + 1; n < 10000; n++){ if(gcd(m, n) != 1){ continue;} final int a = Math.abs(m * m - n * n); final int b = 2 * m * n; final int c = n * n + m * m; if(gcd(a, gcd(b, c)) != 1){ continue; } final long sum = (a + b + c) * 4l; if(sum > L){ break; } //System.out.println(a + " " + b + " " + c); count++; } } System.out.println(count); } }