'''simple docstring'''





from __future__ import annotations


def      a__ (		__UpperCamelCase				):
      create_state_space_tree(lowerCAmelCase__     ,      []     ,      0     ,      [0 for i in range(len(lowerCAmelCase__				)				)]				)


def      a__ (		__UpperCamelCase     ,      __UpperCamelCase     ,      __UpperCamelCase     ,      __UpperCamelCase     ,      ):

      if index == len(lowerCAmelCase__				):
            print(lowerCAmelCase__				)
            return

      for i in range(len(lowerCAmelCase__				)				):
            if not index_used[i]:
                  current_sequence.append(sequence[i]				)
                  SCREAMING_SNAKE_CASE_          =  True
                  create_state_space_tree(lowerCAmelCase__     ,      lowerCAmelCase__     ,      index + 1     ,      lowerCAmelCase__				)
                  current_sequence.pop()
                  SCREAMING_SNAKE_CASE_          =  False
A     :  list[int | str]					     =       [3, 1, 2, 4]
generate_all_permutations(sequence)

A     :  list[int | str]					     =       ["A", "B", "C"]





generate_all_permutations(sequence_a)



from __future__ import annotations


def      a__ (		__UpperCamelCase				):
      SCREAMING_SNAKE_CASE_          =  str(__UpperCamelCase				)
      return n == n[::-1]


def      a__ (		__UpperCamelCase = 1_0_0_0_0_0_0				):
      SCREAMING_SNAKE_CASE_          =  0

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


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


