






"""simple docstring"""



from collections import defaultdict
from math import gcd




def        _lowerCAmelCase						(							UpperCAmelCase__    :   int = 1_5_0_0_0_0_0 )						->int:
						A__  :					defaultdict											=					defaultdict(UpperCAmelCase__ )
						A__  :					Any											=					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
																		A__  :					str											=					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() = }')














"""simple docstring"""



from __future__ import annotations






class 							__SCREAMING_SNAKE_CASE  :


							def __init__(     self :  Dict     ,      snake_case :  int							):
													'''simple docstring'''





													A__  :					List[Any]											=					order

													# a_{0} ... a_{k}
													A__  :					List[Any]											=					[1.0] + [0.0] * order
													# b_{0} ... b_{k}
													A__  :					str											=					[1.0] + [0.0] * order

													# x[n-1] ... x[n-k]
													A__  :					Union[str, Any]											=					[0.0] * self.order
													# y[n-1] ... y[n-k]
													A__  :					List[str]											=					[0.0] * self.order


							def   _UpperCamelCase    (     self :  Optional[int]     ,      snake_case :  list[float]     ,      snake_case :  list[float]							):
													'''simple docstring'''





													if len(snake_case							) < self.order:
																			A__  :					Any											=					[1.0, *a_coeffs]

													if len(snake_case							) != self.order + 1:
																			A__  :					str											=					(
																			    F'Expected a_coeffs to have {self.order + 1} elements '
																			    F'for {self.order}-order filter, got {len(snake_case							)}'
																			)
																			raise ValueError(snake_case							)

													if len(snake_case							) != self.order + 1:
																			A__  :					Union[str, Any]											=					(
																			    F'Expected b_coeffs to have {self.order + 1} elements '
																			    F'for {self.order}-order filter, got {len(snake_case							)}'
																			)
																			raise ValueError(snake_case							)

													A__  :					Dict											=					a_coeffs
													A__  :					Any											=					b_coeffs


							def   _UpperCamelCase    (     self :  List[str]     ,      snake_case :  float							):
													'''simple docstring'''





													A__  :					str											=					0.0

													# Start at index 1 and do index 0 at the end.
													for i in range(1     ,      self.order + 1							):
																			result += (
																			    self.b_coeffs[i] * self.input_history[i - 1]
																			    - self.a_coeffs[i] * self.output_history[i - 1]
																			)

													A__  :					Dict											=					(result + self.b_coeffs[0] * sample) / self.a_coeffs[0]

													A__  :					Tuple											=					self.input_history[:-1]
													A__  :					int											=					self.output_history[:-1]

													A__  :					Dict											=					sample
													A__  :					Tuple											=					result

													return result






