using System; using System.Collections.Generic; using System.Linq; // https://yukicoder.me/problems/no/1591 class Program { static string InputPattern = "InputX"; static List GetInputList() { var WillReturn = new List(); if (InputPattern == "Input1") { WillReturn.Add(""); } else if (InputPattern == "Input2") { WillReturn.Add(""); } else if (InputPattern == "Input3") { WillReturn.Add(""); } else { string wkStr; while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr); } return WillReturn; } static void Main() { List InputList = GetInputList(); long N = long.Parse(InputList[0]); long Answer = 0; for (long I = 1; I * I <= N; I++) { for (long J = 1; I * I + J * J <= N * N; J++) { if (I * I + J * J == N*N) { Answer++; } } } Console.WriteLine(Answer); } }