
from __future__ import annotations

from fractions import Fraction
from math import gcd, sqrt




def 				a						(							snake_case__:					int					):


				'''simple docstring'''
				lowercase_       =					int(number**0.5					)
				return number == sq * sq




def 				a						(							snake_case__:					int						,   snake_case__:					int						,   snake_case__:					int						,   snake_case__:					int						,   snake_case__:					int						,   snake_case__:					int					):


				'''simple docstring'''
				lowercase_       =					x_num * y_den * z_den + y_num * x_den * z_den + z_num * x_den * y_den
				lowercase_       =					x_den * y_den * z_den
				lowercase_       =					gcd(snake_case__						,   snake_case__					)
				top //= hcf
				bottom //= hcf
				return top, bottom




def 				a						(							snake_case__:					int = 35					):


				'''simple docstring'''
				lowercase_       =					set()
				lowercase_       =					42
				lowercase_       =					Fraction(0					)
				lowercase_       =					42

				for x_num in range(1						,   order + 1					):
								for x_den in range(x_num + 1						,   order + 1					):
												for y_num in range(1						,   order + 1					):
																for y_den in range(y_num + 1						,   order + 1					):
																				# n=1
																				lowercase_       =					x_num * y_den + x_den * y_num
																				lowercase_       =					x_den * y_den
																				lowercase_       =					gcd(snake_case__						,   snake_case__					)
																				z_num //= hcf
																				z_den //= hcf
																				if 0 < z_num < z_den <= order:
																								lowercase_       =					add_three(
																								    snake_case__						,   snake_case__						,   snake_case__						,   snake_case__						,   snake_case__						,   snake_case__					)
																								unique_s.add(snake_case__					)

																				# n=2
																				lowercase_       =					(
																				    x_num * x_num * y_den * y_den + x_den * x_den * y_num * y_num
																				)
																				lowercase_       =					x_den * x_den * y_den * y_den
																				if is_sq(snake_case__					) and is_sq(snake_case__					):
																								lowercase_       =					int(sqrt(snake_case__					)					)
																								lowercase_       =					int(sqrt(snake_case__					)					)
																								lowercase_       =					gcd(snake_case__						,   snake_case__					)
																								z_num //= hcf
																								z_den //= hcf
																								if 0 < z_num < z_den <= order:
																												lowercase_       =					add_three(
																												    snake_case__						,   snake_case__						,   snake_case__						,   snake_case__						,   snake_case__						,   snake_case__					)
																												unique_s.add(snake_case__					)

                    # n=-1
																				lowercase_       =					x_num * y_num
																				lowercase_       =					x_den * y_num + x_num * y_den
																				lowercase_       =					gcd(snake_case__						,   snake_case__					)
																				z_num //= hcf
																				z_den //= hcf
																				if 0 < z_num < z_den <= order:
																								lowercase_       =					add_three(
																								    snake_case__						,   snake_case__						,   snake_case__						,   snake_case__						,   snake_case__						,   snake_case__					)
																								unique_s.add(snake_case__					)

																				# n=2
																				lowercase_       =					x_num * x_num * y_num * y_num
																				lowercase_       =					(
																				    x_den * x_den * y_num * y_num + x_num * x_num * y_den * y_den
																				)
																				if is_sq(snake_case__					) and is_sq(snake_case__					):
																								lowercase_       =					int(sqrt(snake_case__					)					)
																								lowercase_       =					int(sqrt(snake_case__					)					)
																								lowercase_       =					gcd(snake_case__						,   snake_case__					)
																								z_num //= hcf
																								z_den //= hcf
																								if 0 < z_num < z_den <= order:
																												lowercase_       =					add_three(
																												    snake_case__						,   snake_case__						,   snake_case__						,   snake_case__						,   snake_case__						,   snake_case__					)
																												unique_s.add(snake_case__					)

				for num, den in unique_s:
								total += Fraction(snake_case__						,   snake_case__					)

				return total.denominator + total.numerator


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






def 				a						(							snake_case__:					list					):


				'''simple docstring'''

				if len(snake_case__					) <= 1:
								return [tuple(snake_case__					)]

				lowercase_       =					[]

				def generate(snake_case__:					int						,   snake_case__:					list					):
								if k == 1:
												res.append(tuple(arr[:]					)					)
												return

								generate(k - 1						,   snake_case__					)

								for i in range(k - 1					):
												if k % 2 == 0:  # k is even
																lowercase_  ,	lowercase_       =					arr[k - 1], arr[i]
												else:  # k is odd
																lowercase_  ,	lowercase_       =					arr[k - 1], arr[0]
												generate(k - 1						,   snake_case__					)

				generate(len(snake_case__					)						,   snake_case__					)
				return res


if __name__ == "__main__":
						__a  			=					input('Enter numbers separated by a comma:\n').strip()
						__a  			=					[int(item) for item in user_input.split(',')]
						print(heaps(arr))




