def 		__lowerCamelCase							():




					for a in range(3_0_0     ):
										for b in range(a + 1					,       4_0_0     ):
															for c in range(b + 1					,       5_0_0     ):
																				if (a + b + c) == 1_0_0_0 and (a**2) + (b**2) == (c**2):
																									return a * b * c

					return -1





def 		__lowerCamelCase							():




					for a in range(3_0_0     ):
										for b in range(4_0_0     ):
															SCREAMING_SNAKE_CASE				=				1_0_0_0 - a - b
															if a < b < c and (a**2) + (b**2) == (c**2):
																				return a * b * c

					return -1





def 		__lowerCamelCase							():
					import timeit

					print(
					    timeit.timeit("solution()"					,       setup="from __main__ import solution"					,       number=1_0_0_0     )     )
					print(
					    timeit.timeit(
					        "solution_fast()"					,       setup="from __main__ import solution_fast"					,       number=1_0_0_0     )     )


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










'''simple docstring'''
from __future__ import annotations

A							:      List[str] 	=       {1: 1}
def 				snake_case_  (   a__		:	int			):



    """simple docstring"""




    if n in COLLATZ_SEQUENCE_LENGTHS:
        return COLLATZ_SEQUENCE_LENGTHS[n]
    __lowercase							=						n // 2 if n % 2 == 0 else 3 * n + 1
    __lowercase							=						collatz_sequence_length(a__			) + 1
    __lowercase							=						sequence_length
    return sequence_length
def 				snake_case_  (   a__		:	int = 1_00_00_00			):



    """simple docstring"""




    __lowercase							=						max((collatz_sequence_length(a__			), i) for i in range(1    ,a__			)			)
    return result[1]


if __name__ == "__main__":
  print(solution(int(input().strip())))




