def    __lowercase     (						lowerCamelCase					:     int = 1000	):
 UpperCamelCase_, UpperCamelCase_					:						int =					1, 1
 UpperCamelCase_					:						Any =					2
 while True:
  UpperCamelCase_					:						Optional[Any] =					0
  UpperCamelCase_					:						Optional[Any] =					fa + fa
  UpperCamelCase_, UpperCamelCase_					:						str =					fa, f
  index += 1
  for _ in str(lowerCamelCase	):
   i += 1
  if i == n:
   break
 return index


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




from maths.prime_check import is_prime





def    __lowercase     (						lowerCamelCase					:     int	):
 if not isinstance(lowerCamelCase  ,  lowerCamelCase	):
  UpperCamelCase_					:						List[str] =					F"Input value of [number={number}] must be an integer"
  raise TypeError(lowerCamelCase	)
 if is_prime(lowerCamelCase	) and is_prime(number + 2	):
  return number + 2
 else:
  return -1


if __name__ == "__main__":
   import doctest

   doctest.testmod()



