



from __future__ import annotations

def 			A_      (	__a     :				int | str		):

    """simple docstring"""
    a__				      =		str(__a		)
    return n == n[::-1]

def 			A_      (	__a     :				int = 1_000_000		):

    """simple docstring"""
    a__				      =		0

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


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






from .configuration_bert_masked import MaskedBertConfig
from .modeling_bert_masked import (
    MaskedBertForMultipleChoice,
    MaskedBertForQuestionAnswering,
    MaskedBertForSequenceClassification,
    MaskedBertForTokenClassification,
    MaskedBertModel,
)
from .modules import *

