



from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


a      :  Tuple			     =			{'configuration_focalnet': ['FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP', 'FocalNetConfig']}


try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	a      :  Union[str, Any]			     =			[
	    'FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST',
	    'FocalNetForImageClassification',
	    'FocalNetForMaskedImageModeling',
	    'FocalNetBackbone',
	    'FocalNetModel',
	    'FocalNetPreTrainedModel',
	]

if TYPE_CHECKING:
	from .configuration_focalnet import FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP, FocalNetConfig

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_focalnet import (
		    FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST,
		    FocalNetBackbone,
		    FocalNetForImageClassification,
		    FocalNetForMaskedImageModeling,
		    FocalNetModel,
		    FocalNetPreTrainedModel,
		)

else:
	import sys

	a      :  Optional[Any]			     =			_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)











from __future__ import annotations







def  lowerCAmelCase_	(lowerCAmelCase__:		int | str  ):





			"""simple docstring"""


			UpperCAmelCase_:		Optional[int]							      =     str(lowerCAmelCase__  )
			return n == n[::-1]







def  lowerCAmelCase_	(lowerCAmelCase__:		int = 1_0_0_0_0_0_0  ):





			"""simple docstring"""


			UpperCAmelCase_:		int							      =     0

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


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






