



'''simple docstring'''

from __future__ import annotations

from math import pi

# Define the Reduced Planck Constant ℏ (H bar), speed of light C, value of
# Pi and the function
snake_case_			=     1.0_5457_1817E-34  # unit of ℏ : J * s

snake_case_			=     3E8  # unit of c : m * s^-1






def       __lowercase  (_SCREAMING_SNAKE_CASE      :float    ,	_SCREAMING_SNAKE_CASE      :float    ,	_SCREAMING_SNAKE_CASE      :float       ):

				if (force, area, distance).count(0       ) != 1:
								raise ValueError('''One and only one argument must be 0'''       )
				if force < 0:
								raise ValueError('''Magnitude of force can not be negative'''       )
				if distance < 0:
								raise ValueError('''Distance can not be negative'''       )
				if area < 0:
								raise ValueError('''Area can not be negative'''       )
				if force == 0:
								SCREAMING_SNAKE_CASE  :						str      					= (REDUCED_PLANCK_CONSTANT * SPEED_OF_LIGHT * pi**2 * area) / (
								    2_40 * (distance) ** 4
								)
								return {"force": force}
				elif area == 0:
								SCREAMING_SNAKE_CASE  :						int      					= (2_40 * force * (distance) ** 4) / (
								    REDUCED_PLANCK_CONSTANT * SPEED_OF_LIGHT * pi**2
								)
								return {"area": area}
				elif distance == 0:
								SCREAMING_SNAKE_CASE  :						int      					= (
								    (REDUCED_PLANCK_CONSTANT * SPEED_OF_LIGHT * pi**2 * area) / (2_40 * force)
								) ** (1 / 4)
								return {"distance": distance}
				raise ValueError('''One and only one argument must be 0'''       )


# Run doctest
if __name__ == "__main__":
	import doctest

	doctest.testmod()









'''simple docstring'''

from __future__ import annotations






def       __lowercase  (_SCREAMING_SNAKE_CASE      :int | str       ):
				SCREAMING_SNAKE_CASE  :						int      					= str(_SCREAMING_SNAKE_CASE       )
				return n == n[::-1]






def       __lowercase  (_SCREAMING_SNAKE_CASE      :int = 1_00_00_00       ):
				SCREAMING_SNAKE_CASE  :						int      					= 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()))))




