

import copy
import os
from typing import Union

from ...configuration_utils import PretrainedConfig
from ...utils import logging


_UpperCAmelCase						:  List[Any]									=			logging.get_logger(__name__)

_UpperCAmelCase						:  List[Any]									=			{
    """google/pix2struct-textcaps-base""": (
        """https://huggingface.co/google/pix2struct-textcaps-base/resolve/main/config.json"""
    ),
}







class 					lowercase							(			lowercase_     ):
				__SCREAMING_SNAKE_CASE   :					List[str]			     =     '''pix2struct_text_model'''
				__SCREAMING_SNAKE_CASE   :					Union[str, Any]			     =     ['''past_key_values''']
				__SCREAMING_SNAKE_CASE   :					Any			     =     {
				    '''hidden_size''': '''hidden_size''',
				    '''num_attention_heads''': '''num_heads''',
				    '''num_hidden_layers''': '''num_layers''',
				}




				def __init__(   self ,  snake_case=5_0244 ,  snake_case=768 ,  snake_case=64 ,  snake_case=2048 ,  snake_case=12 ,  snake_case=12 ,  snake_case=32 ,  snake_case=128 ,  snake_case=0.1 ,  snake_case=1e-6 ,  snake_case=1.0 ,  snake_case="gelu_new" ,  snake_case=0 ,  snake_case=False ,  snake_case=0 ,  snake_case=1 ,  snake_case=False ,  snake_case=True ,  **snake_case ,  ):
											snake_case_     							=       vocab_size
											snake_case_     							=       hidden_size
											snake_case_     							=       d_kv
											snake_case_     							=       d_ff
											snake_case_     							=       num_layers
											snake_case_     							=       num_heads
											snake_case_     							=       relative_attention_num_buckets
											snake_case_     							=       relative_attention_max_distance
											snake_case_     							=       dropout_rate
											snake_case_     							=       layer_norm_epsilon
											snake_case_     							=       initializer_factor
											snake_case_     							=       use_cache

											snake_case_     							=       eos_token_id
											snake_case_     							=       decoder_start_token_id

											# for backwards compatibility
											snake_case_     							=       dense_act_fn

											super().__init__(
											    pad_token_id=snake_case ,  eos_token_id=snake_case ,  decoder_start_token_id=snake_case ,  tie_word_embeddings=snake_case ,  is_decoder=snake_case ,  **snake_case ,  )




				@classmethod
				def        a				(   cls ,  snake_case ,  **snake_case			):
											cls._set_token_in_kwargs(snake_case			)

											snake_case_							,       snake_case_     							=       cls.get_config_dict(snake_case ,  **snake_case			)

											# get the text config dict if we are loading from Pix2StructConfig
											if config_dict.get('model_type'			) == "pix2struct":
																		snake_case_     							=       config_dict['text_config']

											if "model_type" in config_dict and hasattr(cls ,  'model_type'			) and config_dict["model_type"] != cls.model_type:
																		logger.warning(
																		    F'''You are using a model of type {config_dict["model_type"]} to instantiate a model of type '''
																		    F'''{cls.model_type}. This is not supported for all configurations of models and can yield errors.'''			)

											return cls.from_dict(snake_case ,  **snake_case			)







class 					lowercase							(			lowercase_     ):
				__SCREAMING_SNAKE_CASE   :					List[Any]			     =     '''pix2struct_vision_model'''




				def __init__(   self ,  snake_case=768 ,  snake_case=768 ,  snake_case=2048 ,  snake_case=64 ,  snake_case=12 ,  snake_case=12 ,  snake_case="gelu_new" ,  snake_case=1e-6 ,  snake_case=0.0 ,  snake_case=0.0 ,  snake_case=1e-1_0 ,  snake_case=1.0 ,  snake_case=4096 ,  snake_case=32 ,  snake_case=128 ,  **snake_case ,  ):
											super().__init__(**snake_case			)

											snake_case_     							=       hidden_size
											snake_case_     							=       patch_embed_hidden_size
											snake_case_     							=       d_ff
											snake_case_     							=       dropout_rate
											snake_case_     							=       num_hidden_layers
											snake_case_     							=       num_attention_heads
											snake_case_     							=       initializer_range
											snake_case_     							=       initializer_factor
											snake_case_     							=       attention_dropout
											snake_case_     							=       layer_norm_eps
											snake_case_     							=       dense_act_fn
											snake_case_     							=       seq_len
											snake_case_     							=       relative_attention_num_buckets
											snake_case_     							=       relative_attention_max_distance
											snake_case_     							=       d_kv




				@classmethod
				def        a				(   cls ,  snake_case ,  **snake_case			):
											cls._set_token_in_kwargs(snake_case			)

											snake_case_							,       snake_case_     							=       cls.get_config_dict(snake_case ,  **snake_case			)

											# get the vision config dict if we are loading from Pix2StructConfig
											if config_dict.get('model_type'			) == "pix2struct":
																		snake_case_     							=       config_dict['vision_config']

											if "model_type" in config_dict and hasattr(cls ,  'model_type'			) and config_dict["model_type"] != cls.model_type:
																		logger.warning(
																		    F'''You are using a model of type {config_dict["model_type"]} to instantiate a model of type '''
																		    F'''{cls.model_type}. This is not supported for all configurations of models and can yield errors.'''			)

											return cls.from_dict(snake_case ,  **snake_case			)







class 					lowercase							(			lowercase_     ):
				__SCREAMING_SNAKE_CASE   :					Union[str, Any]			     =     '''pix2struct'''
				__SCREAMING_SNAKE_CASE   :					Optional[Any]			     =     True




				def __init__(   self ,  snake_case=None ,  snake_case=None ,  snake_case=1.0 ,  snake_case=0.02 ,  snake_case=False ,  snake_case=False ,  snake_case=True ,  **snake_case ,  ):
											super().__init__(tie_word_embeddings=snake_case ,  is_encoder_decoder=snake_case ,  **snake_case			)

											if text_config is None:
																		snake_case_     							=       {}
																		logger.info('text_config is None. Initializing the Pix2StructTextConfig with default values.'			)

											if vision_config is None:
																		snake_case_     							=       {}
																		logger.info('vision_config is None. Initializing the Pix2StructVisionConfig with default values.'			)

											snake_case_     							=       PixaStructTextConfig(**snake_case			)
											snake_case_     							=       PixaStructVisionConfig(**snake_case			)

											snake_case_     							=       self.text_config.decoder_start_token_id
											snake_case_     							=       self.text_config.pad_token_id
											snake_case_     							=       self.text_config.eos_token_id

											snake_case_     							=       initializer_factor
											snake_case_     							=       initializer_range

											snake_case_     							=       self.initializer_range
											snake_case_     							=       self.initializer_range

											snake_case_     							=       is_vqa




				@classmethod
				def        a				(   cls ,  snake_case ,  snake_case ,  **snake_case			):
											return cls(text_config=text_config.to_dict() ,  vision_config=vision_config.to_dict() ,  **snake_case			)




				def        a				(   self			):
											snake_case_     							=       copy.deepcopy(self.__dict__			)
											snake_case_     							=       self.text_config.to_dict()
											snake_case_     							=       self.vision_config.to_dict()
											snake_case_     							=       self.__class__.model_type
											return output







def    __lowerCamelCase      (					UpperCamelCase__ = 1000 ):







							'''simple docstring'''






							snake_case_     							=       2**power
							snake_case_     							=       0
							while n:
														snake_case_							,       snake_case_     							=       r + n % 10, n // 10
							return r


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




