'''simple docstring'''

import copy
import os
from collections import OrderedDict
from typing import TYPE_CHECKING, Any, Dict, Mapping, Optional, Union


if TYPE_CHECKING:
							from ...processing_utils import ProcessorMixin
							from ...utils import TensorType

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


lowercase_     		= logging.get_logger(__name__)

lowercase_     		= {
    '''google/owlvit-base-patch32''': '''https://huggingface.co/google/owlvit-base-patch32/resolve/main/config.json''',
    '''google/owlvit-base-patch16''': '''https://huggingface.co/google/owlvit-base-patch16/resolve/main/config.json''',
    '''google/owlvit-large-patch14''': '''https://huggingface.co/google/owlvit-large-patch14/resolve/main/config.json''',
}
class   SCREAMING_SNAKE_CASE			(						__lowercase):







		"""simple docstring"""
		lowercase   :      Any       =							'owlvit_text_model'






		def __init__(   self		,						__A=4_9408		,						__A=512		,						__A=2048		,						__A=12		,						__A=8		,						__A=16		,						__A="quick_gelu"		,						__A=1E-5		,						__A=0.0		,						__A=0.02		,						__A=1.0		,						__A=0		,						__A=4_9406		,						__A=4_9407		,						**__A		,						) ->     Any:
								super().__init__(pad_token_id=__A		,						bos_token_id=__A		,						eos_token_id=__A		,						**__A				)

								_lowerCAmelCase										=vocab_size
								_lowerCAmelCase										=hidden_size
								_lowerCAmelCase										=intermediate_size
								_lowerCAmelCase										=num_hidden_layers
								_lowerCAmelCase										=num_attention_heads
								_lowerCAmelCase										=max_position_embeddings
								_lowerCAmelCase										=hidden_act
								_lowerCAmelCase										=layer_norm_eps
								_lowerCAmelCase										=attention_dropout
								_lowerCAmelCase										=initializer_range
								_lowerCAmelCase										=initializer_factor






		@classmethod
		def 		UpperCamelCase__       (   cls		,						__A		,						**__A				) ->     "PretrainedConfig":
								cls._set_token_in_kwargs(__A				)

								_lowerCAmelCase						,				_lowerCAmelCase										=cls.get_config_dict(__A		,						**__A				)

								# get the text config dict if we are loading from OwlViTConfig
								if config_dict.get('model_type'				) == "owlvit":
														_lowerCAmelCase										=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(__A		,						**__A				)

class   SCREAMING_SNAKE_CASE			(						__lowercase):







		"""simple docstring"""
		lowercase   :      Optional[int]       =							'owlvit_vision_model'






		def __init__(   self		,						__A=768		,						__A=3072		,						__A=12		,						__A=12		,						__A=3		,						__A=768		,						__A=32		,						__A="quick_gelu"		,						__A=1E-5		,						__A=0.0		,						__A=0.02		,						__A=1.0		,						**__A		,						) ->     Dict:
								super().__init__(**__A				)

								_lowerCAmelCase										=hidden_size
								_lowerCAmelCase										=intermediate_size
								_lowerCAmelCase										=num_hidden_layers
								_lowerCAmelCase										=num_attention_heads
								_lowerCAmelCase										=num_channels
								_lowerCAmelCase										=image_size
								_lowerCAmelCase										=patch_size
								_lowerCAmelCase										=hidden_act
								_lowerCAmelCase										=layer_norm_eps
								_lowerCAmelCase										=attention_dropout
								_lowerCAmelCase										=initializer_range
								_lowerCAmelCase										=initializer_factor






		@classmethod
		def 		UpperCamelCase__       (   cls		,						__A		,						**__A				) ->     "PretrainedConfig":
								cls._set_token_in_kwargs(__A				)

								_lowerCAmelCase						,				_lowerCAmelCase										=cls.get_config_dict(__A		,						**__A				)

								# get the vision config dict if we are loading from OwlViTConfig
								if config_dict.get('model_type'				) == "owlvit":
														_lowerCAmelCase										=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(__A		,						**__A				)

class   SCREAMING_SNAKE_CASE			(						__lowercase):







		"""simple docstring"""
		lowercase   :      Optional[int]       =							'owlvit'
		lowercase   :      Optional[int]       =							True






		def __init__(   self		,						__A=None		,						__A=None		,						__A=512		,						__A=2.6_592		,						__A=True		,						**__A		,						) ->     Optional[int]:
								super().__init__(**__A				)

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

								if vision_config is None:
														_lowerCAmelCase										={}
														logger.info('vision_config is None. initializing the OwlViTVisionConfig with default values.'				)

								_lowerCAmelCase										=OwlViTTextConfig(**__A				)
								_lowerCAmelCase										=OwlViTVisionConfig(**__A				)

								_lowerCAmelCase										=projection_dim
								_lowerCAmelCase										=logit_scale_init_value
								_lowerCAmelCase										=return_dict
								_lowerCAmelCase										=1.0






		@classmethod
		def 		UpperCamelCase__       (   cls		,						__A		,						**__A				) ->     "PretrainedConfig":
								cls._set_token_in_kwargs(__A				)

								_lowerCAmelCase						,				_lowerCAmelCase										=cls.get_config_dict(__A		,						**__A				)

								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(__A		,						**__A				)






		@classmethod
		def 		UpperCamelCase__       (   cls		,						__A		,						__A		,						**__A				) ->     Union[str, Any]:
								_lowerCAmelCase										={}
								_lowerCAmelCase										=text_config
								_lowerCAmelCase										=vision_config

								return cls.from_dict(__A		,						**__A				)






		def 		UpperCamelCase__       (   self				) ->     Union[str, Any]:
								_lowerCAmelCase										=copy.deepcopy(self.__dict__				)
								_lowerCAmelCase										=self.text_config.to_dict()
								_lowerCAmelCase										=self.vision_config.to_dict()
								_lowerCAmelCase										=self.__class__.model_type
								return output

class   SCREAMING_SNAKE_CASE			(						__lowercase):







		"""simple docstring"""






		@property
		def 		UpperCamelCase__       (   self				) ->     Mapping[str, Mapping[int, str]]:
								return OrderedDict(
								    [
								        ('input_ids', {0: 'batch', 1: 'sequence'}),
								        ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
								        ('attention_mask', {0: 'batch', 1: 'sequence'}),
								    ]				)






		@property
		def 		UpperCamelCase__       (   self				) ->     Mapping[str, Mapping[int, str]]:
								return OrderedDict(
								    [
								        ('logits_per_image', {0: 'batch'}),
								        ('logits_per_text', {0: 'batch'}),
								        ('text_embeds', {0: 'batch'}),
								        ('image_embeds', {0: 'batch'}),
								    ]				)






		@property
		def 		UpperCamelCase__       (   self				) ->     float:
								return 1E-4






		def 		UpperCamelCase__       (   self		,						__A		,						__A = -1		,						__A = -1		,						__A = None		,						) ->     Mapping[str, Any]:
								_lowerCAmelCase										=super().generate_dummy_inputs(
								    processor.tokenizer		,						batch_size=__A		,						seq_length=__A		,						framework=__A				)
								_lowerCAmelCase										=super().generate_dummy_inputs(
								    processor.image_processor		,						batch_size=__A		,						framework=__A				)
								return {**text_input_dict, **image_input_dict}






		@property
		def 		UpperCamelCase__       (   self				) ->     int:
								return 14






'''simple docstring'''

def 							UpperCamelCase__			(			a__ = 1_0_0_0      ):


						'''simple docstring'''






						_lowerCAmelCase										=2**power
						_lowerCAmelCase										=0
						while n:
												_lowerCAmelCase						,				_lowerCAmelCase										=r + n % 1_0, n // 1_0
						return r


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





