




'''simple docstring'''

from __future__ import annotations

import requests


def 						__magic_name__       (      __UpperCAmelCase      )						->   List[str]:

					'''simple docstring'''

					snake_case_		     =							F"https://hacker-news.firebaseio.com/v0/item/{story_id}.json?print=pretty"
					return requests.get(lowerCAmelCase__      ).json()


def 						__magic_name__       (      __UpperCAmelCase = 10      )						->   Tuple:

					'''simple docstring'''

					snake_case_		     =							"""https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty"""
					snake_case_		     =							requests.get(lowerCAmelCase__      ).json()[:max_stories]
					return [get_hackernews_story(lowerCAmelCase__      ) for story_id in story_ids]


def 						__magic_name__       (      __UpperCAmelCase = 10      )						->   Dict:

					'''simple docstring'''

					snake_case_		     =							hackernews_top_stories(lowerCAmelCase__      )
					return "\n".join('''* [{title}]({url})'''.format(**lowerCAmelCase__      ) for story in stories      )


if __name__ == "__main__":
							print(hackernews_top_stories_as_markdown())






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






