
import torch
import torch.nn as nn
from transformers.modeling_utils import ModuleUtilsMixin
from transformers.models.ta.modeling_ta import TaBlock, TaConfig, TaLayerNorm

from ...configuration_utils import ConfigMixin, register_to_config
from ...models import ModelMixin
class  lowercase__(				UpperCAmelCase ,						UpperCAmelCase ,						UpperCAmelCase							):



	"""simple docstring"""




	@register_to_config
	def __init__(       self  :			Union[str, Any]       ,							SCREAMING_SNAKE_CASE_  :			int       ,							SCREAMING_SNAKE_CASE_  :			int       ,							SCREAMING_SNAKE_CASE_  :			int       ,							SCREAMING_SNAKE_CASE_  :			float       ,							SCREAMING_SNAKE_CASE_  :			int       ,							SCREAMING_SNAKE_CASE_  :			int       ,							SCREAMING_SNAKE_CASE_  :			int       ,							SCREAMING_SNAKE_CASE_  :			int       ,							SCREAMING_SNAKE_CASE_  :			str       ,							SCREAMING_SNAKE_CASE_  :			bool = False       ,							)       ->     Optional[int]:
					super().__init__()

					lowercase_       =					nn.Embedding(SCREAMING_SNAKE_CASE_       ,							SCREAMING_SNAKE_CASE_       )

					lowercase_       =					nn.Embedding(SCREAMING_SNAKE_CASE_       ,							SCREAMING_SNAKE_CASE_       )
					lowercase_       =					False

					lowercase_       =					nn.Dropout(p=SCREAMING_SNAKE_CASE_       )

					lowercase_       =					TaConfig(
					    vocab_size=SCREAMING_SNAKE_CASE_       ,							d_model=SCREAMING_SNAKE_CASE_       ,							num_heads=SCREAMING_SNAKE_CASE_       ,							d_kv=SCREAMING_SNAKE_CASE_       ,							d_ff=SCREAMING_SNAKE_CASE_       ,							dropout_rate=SCREAMING_SNAKE_CASE_       ,							feed_forward_proj=SCREAMING_SNAKE_CASE_       ,							is_decoder=SCREAMING_SNAKE_CASE_       ,							is_encoder_decoder=SCREAMING_SNAKE_CASE_       ,							)

					lowercase_       =					nn.ModuleList()
					for lyr_num in range(SCREAMING_SNAKE_CASE_       ):
									lowercase_       =					TaBlock(SCREAMING_SNAKE_CASE_       )
									self.encoders.append(SCREAMING_SNAKE_CASE_       )

					lowercase_       =					TaLayerNorm(SCREAMING_SNAKE_CASE_       )
					lowercase_       =					nn.Dropout(p=SCREAMING_SNAKE_CASE_       )




	def 						_lowercase  (       self  :			List[Any]       ,							SCREAMING_SNAKE_CASE_  :			Any       ,							SCREAMING_SNAKE_CASE_  :			List[Any]       )       ->     Optional[Any]:
					lowercase_       =					self.token_embedder(SCREAMING_SNAKE_CASE_       )

					lowercase_       =					encoder_input_tokens.shape[1]
					lowercase_       =					torch.arange(SCREAMING_SNAKE_CASE_       ,							device=encoder_input_tokens.device       )
					x += self.position_encoding(SCREAMING_SNAKE_CASE_       )

					lowercase_       =					self.dropout_pre(SCREAMING_SNAKE_CASE_       )

					# inverted the attention mask
					lowercase_       =					encoder_input_tokens.size()
					lowercase_       =					self.get_extended_attention_mask(SCREAMING_SNAKE_CASE_       ,							SCREAMING_SNAKE_CASE_       )

					for lyr in self.encoders:
									lowercase_       =					lyr(SCREAMING_SNAKE_CASE_       ,							SCREAMING_SNAKE_CASE_       )[0]
					lowercase_       =					self.layer_norm(SCREAMING_SNAKE_CASE_       )

					return self.dropout_post(SCREAMING_SNAKE_CASE_       ), encoder_inputs_mask










def 			_SCREAMING_SNAKE_CASE			(							lowercase	:       int = 10_00     ):


      '''simple docstring'''



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


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



