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 int gcd(int a, int 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; for(int a = 1; a <= 10000; a++){ for(int b = a + 1; b <= 10000; b++){ final int c = (int)(Math.floor(Math.sqrt(a * a + b * b))); if(a * a + b * b != c * c){ continue; } final int gcd = gcd(a, gcd(b, c)); final int sum = a + b + c; if(gcd != 1){ continue; } if(sum * 4L > L){ continue; } //System.out.println(a + " " + b + " " + c + " " + sum); count++; } } System.out.println(count); } }