from collections import defaultdict
from math import gcd


def    a__       (						__UpperCamelCase = 1_5_0_0_0_0_0 ):
      SCREAMING_SNAKE_CASE_      =     defaultdict(__UpperCamelCase )
      SCREAMING_SNAKE_CASE_      =     2
      while 2 * euclid_m * (euclid_m + 1) <= limit:
            for euclid_n in range((euclid_m % 2) + 1   ,					__UpperCamelCase   ,					2 ):
                  if gcd(__UpperCamelCase   ,					__UpperCamelCase ) > 1:
                        continue
                  SCREAMING_SNAKE_CASE_      =     2 * euclid_m * (euclid_m + euclid_n)
                  for perimeter in range(__UpperCamelCase   ,					limit + 1   ,					__UpperCamelCase ):
                        frequencies[perimeter] += 1
            euclid_m += 1
      return sum(1 for frequency in frequencies.values() if frequency == 1 )


if __name__ == "__main__":
      print(f"{solution() = }")



def    a__       (						__UpperCamelCase = 1_0_0_0 ):
      SCREAMING_SNAKE_CASE_      =     -1
      SCREAMING_SNAKE_CASE_      =     0
      for a in range(1   ,					n // 3 ):
            # Solving the two equations a**2+b**2=c**2 and a+b+c=N eliminating c
            SCREAMING_SNAKE_CASE_      =     (n * n - 2 * a * n) // (2 * n - 2 * a)
            SCREAMING_SNAKE_CASE_      =     n - a - b
            if c * c == (a * a + b * b):
                  SCREAMING_SNAKE_CASE_      =     a * b * c
                  if candidate >= product:
                        SCREAMING_SNAKE_CASE_      =     candidate
      return product


if __name__ == "__main__":
      print(f"{solution() = }")


