



'''simple docstring'''

from __future__ import annotations

import math






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







	"""simple docstring"""

	if num <= 0:
		lowerCAmelCase   =     f'{num}: Invalid input, please enter a positive integer.'
		raise ValueError(_SCREAMING_SNAKE_CASE							)

	lowerCAmelCase   =     [True] * (num + 1)
	lowerCAmelCase   =     []
	lowerCAmelCase   =     2
	lowerCAmelCase   =     int(math.sqrt(_SCREAMING_SNAKE_CASE							)							)

	while start <= end:
		# If start is a prime
		if sieve[start] is True:
			prime.append(_SCREAMING_SNAKE_CASE							)

			# Set multiples of start be False
			for i in range(start * start							,		num + 1							,		_SCREAMING_SNAKE_CASE							):
				if sieve[i] is True:
					lowerCAmelCase   =     False

		start += 1

	for j in range(end + 1							,		num + 1							):
		if sieve[j] is True:
			prime.append(_SCREAMING_SNAKE_CASE							)

	return prime


if __name__ == "__main__":
				print(prime_sieve(int(input('Enter a positive integer: ').strip())))




'''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()))))