"""simple docstring"""




from typing import Optional

from torch import nn

from .transformer_ad import TransformeraDModel, TransformeraDModelOutput

class    a_   (  nn.Module      ):




					def __init__(						self    :  Optional[int]	,    snake_case__    :  int = 16	,    snake_case__    :  int = 88	,    snake_case__    :  Optional[int] = None	,    snake_case__    :  int = 1	,    snake_case__    :  float = 0.0	,    snake_case__    :  int = 32	,    snake_case__    :  Optional[int] = None	,    snake_case__    :  bool = False	,    snake_case__    :  Optional[int] = None	,    snake_case__    :  Optional[int] = None	,    snake_case__    :  str = "geglu"	,    snake_case__    :  Optional[int] = None	,    ):
							super().__init__()
							lowerCAmelCase__   = nn.ModuleList(
							    [
							        TransformeraDModel(
							            num_attention_heads=snake_case__	,    attention_head_dim=snake_case__	,    in_channels=snake_case__	,    num_layers=snake_case__	,    dropout=snake_case__	,    norm_num_groups=snake_case__	,    cross_attention_dim=snake_case__	,    attention_bias=snake_case__	,    sample_size=snake_case__	,    num_vector_embeds=snake_case__	,    activation_fn=snake_case__	,    num_embeds_ada_norm=snake_case__	,    )
							        for _ in range(2  )
							    ]  )

							# Variables that can be set by a pipeline:

							# The ratio of transformer1 to transformer2's output states to be combined during inference
							lowerCAmelCase__   = 0.5

							# The shape of `encoder_hidden_states` is expected to be
							# `(batch_size, condition_lengths[0]+condition_lengths[1], num_features)`
							lowerCAmelCase__   = [77, 257]

							# Which transformer to use to encode which condition.
							# E.g. `(1, 0)` means that we'll use `transformers[1](conditions[0])` and `transformers[0](conditions[1])`
							lowerCAmelCase__   = [1, 0]




					def     _SCREAMING_SNAKE_CASE    (						self    :  int	,    snake_case__    :  Optional[int]	,    snake_case__    :  Union[str, Any]	,    snake_case__    :  Dict=None	,    snake_case__    :  Tuple=None	,    snake_case__    :  int=None	,    snake_case__    :  bool = True	,    ):
							lowerCAmelCase__   = hidden_states

							lowerCAmelCase__   = []
							lowerCAmelCase__   = 0
							# attention_mask is not used yet
							for i in range(2  ):
									# for each of the two transformers, pass the corresponding condition tokens
									lowerCAmelCase__   = encoder_hidden_states[:, tokens_start : tokens_start + self.condition_lengths[i]]
									lowerCAmelCase__   = self.transformer_index_for_condition[i]
									lowerCAmelCase__   = self.transformers[transformer_index](
									    snake_case__	,    encoder_hidden_states=snake_case__	,    timestep=snake_case__	,    cross_attention_kwargs=snake_case__	,    return_dict=snake_case__	,    )[0]
									encoded_states.append(encoded_state - input_states  )
									tokens_start += self.condition_lengths[i]

							lowerCAmelCase__   = encoded_states[0] * self.mix_ratio + encoded_states[1] * (1 - self.mix_ratio)
							lowerCAmelCase__   = output_states + input_states

							if not return_dict:
									return (output_states,)

							return TransformeraDModelOutput(sample=snake_case__  )





"""simple docstring"""




from collections.abc import Generator







def 				_UpperCAmelCase		(							):





		"""simple docstring"""




		lowerCAmelCase__ ,       lowerCAmelCase__   = 0, 1
		while True:
				lowerCAmelCase__ ,       lowerCAmelCase__   = b, a + b
				yield b







def 				_UpperCAmelCase		(							lowerCamelCase__ = 1000  ):





		"""simple docstring"""




		lowerCAmelCase__   = 1
		lowerCAmelCase__   = fibonacci_generator()
		while len(str(next(lowerCamelCase__  )  )  ) < n:
				answer += 1
		return answer + 1


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




