
"""simple docstring"""


import baseaa






def    _snake_case					(		snake_case__ :  str  ):
	return baseaa.baaencode(string.encode('utf-8'  )  )






def    _snake_case					(		snake_case__ :  bytes  ):
	return baseaa.baadecode(snake_case__  ).decode('utf-8'  )


if __name__ == "__main__":
		_lowercase				 =					'''Hello World!'''
		_lowercase				 =					baseaa_encode(test)
		print(encoded)

		_lowercase				 =					baseaa_decode(encoded)
		print(decoded)


'''simple docstring'''




from __future__ import annotations


def    lowerCamelCase__		(    SCREAMING_SNAKE_CASE   : int | str    ):
  UpperCAmelCase    				=						str(SCREAMING_SNAKE_CASE    )
  return n == n[::-1]


def    lowerCamelCase__		(    SCREAMING_SNAKE_CASE   : int = 100_0000    ):
  UpperCAmelCase    				=						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()))))


