





from collections import defaultdict
from math import gcd



def 		A_    (					_lowerCAmelCase = 150_0000					)						->			Union[str, Any]:
 UpperCamelCase     : Any	     =       defaultdict(_a					)
 UpperCamelCase     : Dict	     =       2
 while 2 * euclid_m * (euclid_m + 1) <= limit:
  for euclid_n in range((euclid_m % 2) + 1							,       _a							,       2					):
   if gcd(_a							,       _a					) > 1:
    continue
   UpperCamelCase     : Any	     =       2 * euclid_m * (euclid_m + euclid_n)
   for perimeter in range(_a							,       limit + 1							,       _a					):
    frequencies[perimeter] += 1
  euclid_m += 1
 return sum(1 for frequency in frequencies.values() if frequency == 1					)


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







class  A__       :  # Public class to implement a graph





      def __init__(			self	,							A_	,							A_	,							A_       ):
       '''simple docstring'''




       UpperCamelCase     : Optional[int]	     =       row
       UpperCamelCase     : Any	     =       col
       UpperCamelCase     : Optional[Any]	     =       graph





      def 	__UpperCamelCase(			self	,							A_	,							A_	,							A_       ):
       '''simple docstring'''




       return (
           0 <= i < self.ROW
           and 0 <= j < self.COL
           and not visited[i][j]
           and self.graph[i][j]
       )





      def 	__UpperCamelCase(			self	,							A_	,							A_	,							A_       ):
       '''simple docstring'''




       UpperCamelCase     : Any	     =       [-1, -1, -1, 0, 0, 1, 1, 1]  # Coordinate order
       UpperCamelCase     : Dict	     =       [-1, 0, 1, -1, 1, -1, 0, 1]
       UpperCamelCase     : Any	     =       True  # Make those cells visited
       for k in range(8       ):
        if self.is_safe(i + row_nbr[k]	,							j + col_nbr[k]	,							A_       ):
         self.diffs(i + row_nbr[k]	,							j + col_nbr[k]	,							A_       )





      def 	__UpperCamelCase(			self       ):  # And finally, count all islands.
       '''simple docstring'''




       UpperCamelCase     : str	     =       [[False for j in range(self.COL       )] for i in range(self.ROW       )]
       UpperCamelCase     : int	     =       0
       for i in range(self.ROW       ):
        for j in range(self.COL       ):
         if visited[i][j] is False and self.graph[i][j] == 1:
          self.diffs(A_	,							A_	,							A_       )
          count += 1
       return count
