


'''simple docstring'''







from maths.prime_check import is_prime




def 							__lowercase    (   __SCREAMING_SNAKE_CASE		)					->       Any:
     """simple docstring"""




     if not isinstance(UpperCamelCase__					,	UpperCamelCase__		):
          __a   			= F'''Input value of [number={number}] must be an integer'''
          raise TypeError(UpperCamelCase__		)
     if is_prime(UpperCamelCase__		) and is_prime(number + 2		):
          return number + 2
     else:
          return -1


if __name__ == "__main__":
 import doctest

 doctest.testmod()









def    __lowerCamelCase      (					UpperCamelCase__ = 1000 ):







							'''simple docstring'''






							snake_case_     							=       2**power
							snake_case_     							=       0
							while n:
														snake_case_							,       snake_case_     							=       r + n % 10, n // 10
							return r


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




