

'''simple docstring'''




from __future__ import annotations



class 							lowercase_						:

  '''simple docstring'''





  def __init__(  self ,			a_  )				->					None:


    """simple docstring"""
    UpperCAmelCase    				=						order

    # a_{0} ... a_{k}
    UpperCAmelCase    				=						[1.0] + [0.0] * order
    # b_{0} ... b_{k}
    UpperCAmelCase    				=						[1.0] + [0.0] * order

    # x[n-1] ... x[n-k]
    UpperCAmelCase    				=						[0.0] * self.order
    # y[n-1] ... y[n-k]
    UpperCAmelCase    				=						[0.0] * self.order
  def     snake_case_      (  self ,			a_ ,			a_  )				->					None:


    """simple docstring"""
    if len(a_  ) < self.order:
      UpperCAmelCase    				=						[1.0, *a_coeffs]

    if len(a_  ) != self.order + 1:
      UpperCAmelCase    				=						(
          F'''Expected a_coeffs to have {self.order + 1} elements '''
          F'''for {self.order}-order filter, got {len(a_  )}'''
      )
      raise ValueError(a_  )

    if len(a_  ) != self.order + 1:
      UpperCAmelCase    				=						(
          F'''Expected b_coeffs to have {self.order + 1} elements '''
          F'''for {self.order}-order filter, got {len(a_  )}'''
      )
      raise ValueError(a_  )

    UpperCAmelCase    				=						a_coeffs
    UpperCAmelCase    				=						b_coeffs





  def     snake_case_      (  self ,			a_  )				->					float:


    """simple docstring"""
    UpperCAmelCase    				=						0.0

    # Start at index 1 and do index 0 at the end.
    for i in range(1 ,			self.order + 1  ):
      result += (
          self.b_coeffs[i] * self.input_history[i - 1]
          - self.a_coeffs[i] * self.output_history[i - 1]
      )

    UpperCAmelCase    				=						(result + self.b_coeffs[0] * sample) / self.a_coeffs[0]

    UpperCAmelCase    				=						self.input_history[:-1]
    UpperCAmelCase    				=						self.output_history[:-1]

    UpperCAmelCase    				=						sample
    UpperCAmelCase    				=						result

    return result





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


