
from __future__ import annotations

__a  			=					1.6021E-19  # units = C




def 				a						(							snake_case__:					float						,   snake_case__:					float						,   snake_case__:					float						,   ):


				'''simple docstring'''
				if (conductivity, electron_conc, mobility).count(0					) != 1:
								raise ValueError('''You cannot supply more or less than 2 values'''					)
				elif conductivity < 0:
								raise ValueError('''Conductivity cannot be negative'''					)
				elif electron_conc < 0:
								raise ValueError('''Electron concentration cannot be negative'''					)
				elif mobility < 0:
								raise ValueError('''mobility cannot be negative'''					)
				elif conductivity == 0:
								return (
								    "conductivity",
								    mobility * electron_conc * ELECTRON_CHARGE,
								)
				elif electron_conc == 0:
								return (
								    "electron_conc",
								    conductivity / (mobility * ELECTRON_CHARGE),
								)
				else:
								return (
								    "mobility",
								    conductivity / (electron_conc * ELECTRON_CHARGE),
								)


if __name__ == "__main__":
						import doctest

						doctest.testmod()








"""simple docstring"""
from __future__ import annotations






def 		lowercase							(     _snake_case						:      int | str     )     ->bool:
	"""simple docstring"""





	__snake_case	:						List[str]						=				str(_snake_case     )
	return n == n[::-1]






def 		lowercase							(     _snake_case						:      int = 1_000_000     )     ->str:
	"""simple docstring"""





	__snake_case	:						Union[str, Any]						=				0

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


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





