'''simple docstring'''

import unittest

import numpy as np

from transformers import AlbertConfig, is_flax_available
from transformers.testing_utils import require_flax, slow

from ...test_modeling_flax_common import FlaxModelTesterMixin, ids_tensor, random_attention_mask


if is_flax_available():
       import jax.numpy as jnp

       from transformers.models.albert.modeling_flax_albert import (
           FlaxAlbertForMaskedLM,
           FlaxAlbertForMultipleChoice,
           FlaxAlbertForPreTraining,
           FlaxAlbertForQuestionAnswering,
           FlaxAlbertForSequenceClassification,
           FlaxAlbertForTokenClassification,
           FlaxAlbertModel,
       )





class 							lowercase						(						unittest.TestCase ):


   def __init__(   self				:	Optional[Any]   ,		__lowerCAmelCase				:	Union[str, Any]   ,		__lowerCAmelCase				:	Optional[Any]=13   ,		__lowerCAmelCase				:	str=7   ,		__lowerCAmelCase				:	Tuple=True   ,		__lowerCAmelCase				:	Optional[int]=True   ,		__lowerCAmelCase				:	Any=True   ,		__lowerCAmelCase				:	Any=True   ,		__lowerCAmelCase				:	List[Any]=99   ,		__lowerCAmelCase				:	Any=32   ,		__lowerCAmelCase				:	Dict=5   ,		__lowerCAmelCase				:	int=4   ,		__lowerCAmelCase				:	int=37   ,		__lowerCAmelCase				:	Tuple="gelu"   ,		__lowerCAmelCase				:	Optional[Any]=0.1   ,		__lowerCAmelCase				:	int=0.1   ,		__lowerCAmelCase				:	int=512   ,		__lowerCAmelCase				:	Any=16   ,		__lowerCAmelCase				:	Union[str, Any]=2   ,		__lowerCAmelCase				:	Optional[Any]=0.02   ,		__lowerCAmelCase				:	List[Any]=4   ,		)      ->					List[str]:
         lowercase_     =      parent
         lowercase_     =      batch_size
         lowercase_     =      seq_length
         lowercase_     =      is_training
         lowercase_     =      use_attention_mask
         lowercase_     =      use_token_type_ids
         lowercase_     =      use_labels
         lowercase_     =      vocab_size
         lowercase_     =      hidden_size
         lowercase_     =      num_hidden_layers
         lowercase_     =      num_attention_heads
         lowercase_     =      intermediate_size
         lowercase_     =      hidden_act
         lowercase_     =      hidden_dropout_prob
         lowercase_     =      attention_probs_dropout_prob
         lowercase_     =      max_position_embeddings
         lowercase_     =      type_vocab_size
         lowercase_     =      type_sequence_label_size
         lowercase_     =      initializer_range
         lowercase_     =      num_choices


   def __UpperCAmelCase       (   self				:	Dict)      ->					Optional[Any]:
         lowercase_     =      ids_tensor([self.batch_size, self.seq_length]   ,		self.vocab_size)

         lowercase_     =      None
         if self.use_attention_mask:
               lowercase_     =      random_attention_mask([self.batch_size, self.seq_length])

         lowercase_     =      None
         if self.use_token_type_ids:
               lowercase_     =      ids_tensor([self.batch_size, self.seq_length]   ,		self.type_vocab_size)

         lowercase_     =      AlbertConfig(
             vocab_size=self.vocab_size   ,		hidden_size=self.hidden_size   ,		num_hidden_layers=self.num_hidden_layers   ,		num_attention_heads=self.num_attention_heads   ,		intermediate_size=self.intermediate_size   ,		hidden_act=self.hidden_act   ,		hidden_dropout_prob=self.hidden_dropout_prob   ,		attention_probs_dropout_prob=self.attention_probs_dropout_prob   ,		max_position_embeddings=self.max_position_embeddings   ,		type_vocab_size=self.type_vocab_size   ,		is_decoder=__lowerCAmelCase   ,		initializer_range=self.initializer_range   ,		)

         return config, input_ids, token_type_ids, attention_mask


   def __UpperCAmelCase       (   self				:	Union[str, Any])      ->					Any:
         lowercase_     =      self.prepare_config_and_inputs()
         lowercase_ ,							lowercase_ ,							lowercase_ ,							lowercase_     =      config_and_inputs
         lowercase_     =      {"input_ids": input_ids, "token_type_ids": token_type_ids, "attention_mask": attention_mask}
         return config, inputs_dict





@require_flax
class 							lowercase						(						__lowerCamelCase ,				unittest.TestCase ):
   lowerCamelCase_    					=(
       (
           FlaxAlbertModel,
           FlaxAlbertForPreTraining,
           FlaxAlbertForMaskedLM,
           FlaxAlbertForMultipleChoice,
           FlaxAlbertForQuestionAnswering,
           FlaxAlbertForSequenceClassification,
           FlaxAlbertForTokenClassification,
           FlaxAlbertForQuestionAnswering,
       )
       if is_flax_available()
       else ()
   )


   def __UpperCAmelCase       (   self				:	Dict)      ->					int:
         lowercase_     =      FlaxAlbertModelTester(self)


   @slow
   def __UpperCAmelCase       (   self				:	Dict)      ->					str:
         for model_class_name in self.all_model_classes:
               lowercase_     =      model_class_name.from_pretrained("albert-base-v2")
               lowercase_     =      model(np.ones((1, 1)))
               self.assertIsNotNone(__lowerCAmelCase)





@require_flax
class 							lowercase						(						unittest.TestCase ):


   @slow
   def __UpperCAmelCase       (   self				:	str)      ->					Union[str, Any]:
         lowercase_     =      FlaxAlbertModel.from_pretrained("albert-base-v2")
         lowercase_     =      np.array([[0, 345, 232, 328, 740, 140, 1695, 69, 6078, 1588, 2]])
         lowercase_     =      np.array([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]])
         lowercase_     =      model(__lowerCAmelCase   ,		attention_mask=__lowerCAmelCase)[0]
         lowercase_     =      (1, 11, 768)
         self.assertEqual(output.shape   ,		__lowerCAmelCase)
         lowercase_     =      np.array(
             [[[-0.6513, 1.5035, -0.2766], [-0.6515, 1.5046, -0.2780], [-0.6512, 1.5049, -0.2784]]])

         self.assertTrue(jnp.allclose(output[:, 1:4, 1:4]   ,		__lowerCAmelCase   ,		atol=1e-4))







'''simple docstring'''

from __future__ import annotations


def __a (	__lowerCamelCase			:						int | str				)	->							bool:
      '''simple docstring'''


      lowercase_     =      str(__lowerCamelCase				)
      return n == n[::-1]


def __a (	__lowerCamelCase			:						int = 1_000_000				)	->							Optional[int]:
      '''simple docstring'''


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






