



'''simple docstring'''

def 		_snake_case		( _SCREAMING_SNAKE_CASE					:						int							)      ->						list[int]:







	"""simple docstring"""

	if num <= 0:
		raise ValueError("""Input must be a positive integer"""							)

	lowerCAmelCase   =     [True] * (num + 1)

	lowerCAmelCase   =     2
	while p * p <= num:
		if primes[p]:
			for i in range(p * p							,		num + 1							,		_SCREAMING_SNAKE_CASE							):
				lowerCAmelCase   =     False
		p += 1

	return [prime for prime in range(2							,		num + 1							) if primes[prime]]


if __name__ == "__main__":
				import doctest

				doctest.testmod()

				UpperCAmelCase     		=   int(input('Enter a positive integer: ').strip())
				print(prime_sieve_eratosthenes(user_num))




'''simple docstring'''

from __future__ import annotations






def 		_snake_case		( _SCREAMING_SNAKE_CASE					:						int | str							)      ->						bool:







	"""simple docstring"""
	lowerCAmelCase   =     str(_SCREAMING_SNAKE_CASE							)
	return n == n[::-1]






def 		_snake_case		( _SCREAMING_SNAKE_CASE					:						int = 1_000_000							)      ->						Dict:







	"""simple docstring"""
	lowerCAmelCase   =     0

	for i in range(1							,		_SCREAMING_SNAKE_CASE							):
		if is_palindrome(_SCREAMING_SNAKE_CASE							) and is_palindrome(bin(_SCREAMING_SNAKE_CASE							).split("""b"""							)[1]							):
			total += i
	return total


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