




'''simple docstring'''



import argparse

import torch

from transformers import BertForMaskedLM


if __name__ == "__main__":
      UpperCamelCase_    	=				argparse.ArgumentParser(
          description=(
              "Extraction some layers of the full BertForMaskedLM or RObertaForMaskedLM for Transfer Learned"
              " Distillation"
          )
      )
      parser.add_argument("--model_type", default="bert", choices=["bert"])
      parser.add_argument("--model_name", default="bert-base-uncased", type=str)
      parser.add_argument("--dump_checkpoint", default="serialization_dir/tf_bert-base-uncased_0247911.pth", type=str)
      parser.add_argument("--vocab_transform", action="store_true")
      UpperCamelCase_    	=				parser.parse_args()

      if args.model_type == "bert":
            UpperCamelCase_    	=				BertForMaskedLM.from_pretrained(args.model_name)
            UpperCamelCase_    	=				"bert"
      else:
            raise ValueError("args.model_type should be \"bert\".")

      UpperCamelCase_    	=				model.state_dict()
      UpperCamelCase_    	=				{}

      for w in ["word_embeddings", "position_embeddings"]:
            UpperCamelCase_    	=				state_dict[F"""{prefix}.embeddings.{w}.weight"""]
      for w in ["weight", "bias"]:
            UpperCamelCase_    	=				state_dict[F"""{prefix}.embeddings.LayerNorm.{w}"""]

      UpperCamelCase_    	=				0
      for teacher_idx in [0, 2, 4, 7, 9, 1_1]:
            for w in ["weight", "bias"]:
                  UpperCamelCase_    	=				state_dict[
                      F"""{prefix}.encoder.layer.{teacher_idx}.attention.self.query.{w}"""
                  ]
                  UpperCamelCase_    	=				state_dict[
                      F"""{prefix}.encoder.layer.{teacher_idx}.attention.self.key.{w}"""
                  ]
                  UpperCamelCase_    	=				state_dict[
                      F"""{prefix}.encoder.layer.{teacher_idx}.attention.self.value.{w}"""
                  ]

                  UpperCamelCase_    	=				state_dict[
                      F"""{prefix}.encoder.layer.{teacher_idx}.attention.output.dense.{w}"""
                  ]
                  UpperCamelCase_    	=				state_dict[
                      F"""{prefix}.encoder.layer.{teacher_idx}.attention.output.LayerNorm.{w}"""
                  ]

                  UpperCamelCase_    	=				state_dict[
                      F"""{prefix}.encoder.layer.{teacher_idx}.intermediate.dense.{w}"""
                  ]
                  UpperCamelCase_    	=				state_dict[
                      F"""{prefix}.encoder.layer.{teacher_idx}.output.dense.{w}"""
                  ]
                  UpperCamelCase_    	=				state_dict[
                      F"""{prefix}.encoder.layer.{teacher_idx}.output.LayerNorm.{w}"""
                  ]
            std_idx += 1

      UpperCamelCase_    	=				state_dict["cls.predictions.decoder.weight"]
      UpperCamelCase_    	=				state_dict["cls.predictions.bias"]
      if args.vocab_transform:
            for w in ["weight", "bias"]:
                  UpperCamelCase_    	=				state_dict[F"""cls.predictions.transform.dense.{w}"""]
                  UpperCamelCase_    	=				state_dict[F"""cls.predictions.transform.LayerNorm.{w}"""]

      print(F"""N layers selected for distillation: {std_idx}""")
      print(F"""Number of params transferred for distillation: {len(compressed_sd.keys())}""")

      print(F"""Save transferred checkpoint to {args.dump_checkpoint}.""")
      torch.save(compressed_sd, args.dump_checkpoint)








"""simple docstring"""




def        a__					(							snake_case__ = 10_00							)		->   int:
			lowerCamelCase ,  lowerCamelCase      =   1, 1
			lowerCamelCase      =   2
			while True:
						lowerCamelCase      =   0
						lowerCamelCase      =   fa + fa
						lowerCamelCase ,  lowerCamelCase      =   fa, f
						index += 1
						for _ in str(snake_case__							):
									i += 1
						if i == n:
									break
			return index


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



