




'''simple docstring'''






from __future__ import annotations

A_			      =		tuple[int, int, int]
A_			      =		tuple[str, str, str]


# used alphabet --------------------------
# from string.ascii_uppercase
A_			      =		"ABCDEFGHIJKLMNOPQRSTUVWXYZ"

# -------------------------- default selection --------------------------
# rotors --------------------------
A_			      =		"EGZWVONAHDCLFQMSIPJBYUKXTR"
A_			      =		"FOBHMDKEXQNRAULPGSJVTYICZW"
A_			      =		"ZJXESIUQLHAVRMDOYGTNFWPBKC"
# reflector --------------------------
A_			      =		{
    "A": "N",
    "N": "A",
    "B": "O",
    "O": "B",
    "C": "P",
    "P": "C",
    "D": "Q",
    "Q": "D",
    "E": "R",
    "R": "E",
    "F": "S",
    "S": "F",
    "G": "T",
    "T": "G",
    "H": "U",
    "U": "H",
    "I": "V",
    "V": "I",
    "J": "W",
    "W": "J",
    "K": "X",
    "X": "K",
    "L": "Y",
    "Y": "L",
    "M": "Z",
    "Z": "M",
}

# -------------------------- extra rotors --------------------------
A_			      =		"RMDJXFUWGISLHVTCQNKYPBEZOA"
A_			      =		"SGLCPQWZHKXAREONTFBVIYJUDM"
A_			      =		"HVSICLTYKQUBXDWAJZOMFGPREN"
A_			      =		"RZWQHFMVDBKICJLNTUXAGYPSOE"
A_			      =		"LFKIJODBEGAMQPXVUHYSTCZRWN"
A_			      =		"KOAEGVDHXPQZMLFTYWJNBRCIUS"






def 		UpperCamelCase__      (		__SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE		)    ->   tuple[RotorPositionT, RotorSelectionT, dict[str, str]]:
      # Checks if there are 3 unique rotors

      if (unique_rotsel := len(set(__SCREAMING_SNAKE_CASE		)		)) < 3:
            snake_case__       :   List[Any]	      =    f"Please use 3 unique rotors (not {unique_rotsel})"
            raise Exception(__SCREAMING_SNAKE_CASE		)

      # Checks if rotor positions are valid
      snake_case__      ,							snake_case__      ,							snake_case__       :   str	      =    rotpos
      if not 0 < rotorposa <= len(__SCREAMING_SNAKE_CASE		):
            snake_case__       :   Union[str, Any]	      =    f"First rotor position is not within range of 1..26 ({rotorposa}"
            raise ValueError(__SCREAMING_SNAKE_CASE		)
      if not 0 < rotorposa <= len(__SCREAMING_SNAKE_CASE		):
            snake_case__       :   int	      =    f"Second rotor position is not within range of 1..26 ({rotorposa})"
            raise ValueError(__SCREAMING_SNAKE_CASE		)
      if not 0 < rotorposa <= len(__SCREAMING_SNAKE_CASE		):
            snake_case__       :   Optional[Any]	      =    f"Third rotor position is not within range of 1..26 ({rotorposa})"
            raise ValueError(__SCREAMING_SNAKE_CASE		)

      # Validates string and returns dict
      snake_case__       :   Union[str, Any]	      =    _plugboard(__SCREAMING_SNAKE_CASE		)

      return rotpos, rotsel, pbdict






def 		UpperCamelCase__      (		__SCREAMING_SNAKE_CASE		)    ->   dict[str, str]:

      # tests the input string if it
      # a) is type string
      # b) has even length (so pairs can be made)
      if not isinstance(__SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE		):
            snake_case__       :   Union[str, Any]	      =    f"Plugboard setting isn't type string ({type(__SCREAMING_SNAKE_CASE		)})"
            raise TypeError(__SCREAMING_SNAKE_CASE		)
      elif len(__SCREAMING_SNAKE_CASE		) % 2 != 0:
            snake_case__       :   Optional[int]	      =    f"Odd number of symbols ({len(__SCREAMING_SNAKE_CASE		)})"
            raise Exception(__SCREAMING_SNAKE_CASE		)
      elif pbstring == "":
            return {}

      pbstring.replace(' '				,      ''		)

      # Checks if all characters are unique
      snake_case__       :   List[Any]	      =    set()
      for i in pbstring:
            if i not in abc:
                  snake_case__       :   int	      =    f"'{i}' not in list of symbols"
                  raise Exception(__SCREAMING_SNAKE_CASE		)
            elif i in tmppbl:
                  snake_case__       :   List[str]	      =    f"Duplicate symbol ({i})"
                  raise Exception(__SCREAMING_SNAKE_CASE		)
            else:
                  tmppbl.add(__SCREAMING_SNAKE_CASE		)
      del tmppbl

      # Created the dictionary
      snake_case__       :   Optional[int]	      =    {}
      for j in range(0				,      len(__SCREAMING_SNAKE_CASE		) - 1				,      2		):
            snake_case__       :   Any	      =    pbstring[j + 1]
            snake_case__       :   Optional[int]	      =    pbstring[j]

      return pb






def 		UpperCamelCase__      (		__SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE = (rotora, rotora, rotora)				,      __SCREAMING_SNAKE_CASE = ""				,      )    ->   str:
      snake_case__       :   Dict	      =    text.upper()
      snake_case__      ,							snake_case__      ,							snake_case__       :   Tuple	      =    _validator(
          __SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE				,      plugb.upper()		)

      snake_case__      ,							snake_case__      ,							snake_case__       :   Any	      =    rotor_position
      snake_case__      ,							snake_case__      ,							snake_case__       :   Optional[Any]	      =    rotor_selection
      rotorposa -= 1
      rotorposa -= 1
      rotorposa -= 1

      snake_case__       :   Any	      =    []

      # encryption/decryption process --------------------------
      for symbol in text:
            if symbol in abc:
                  # 1st plugboard --------------------------
                  if symbol in plugboard:
                        snake_case__       :   List[str]	      =    plugboard[symbol]

                  # rotor ra --------------------------
                  snake_case__       :   Optional[Any]	      =    abc.index(__SCREAMING_SNAKE_CASE		) + rotorposa
                  snake_case__       :   List[str]	      =    rotora[index % len(__SCREAMING_SNAKE_CASE		)]

                  # rotor rb --------------------------
                  snake_case__       :   Tuple	      =    abc.index(__SCREAMING_SNAKE_CASE		) + rotorposa
                  snake_case__       :   str	      =    rotora[index % len(__SCREAMING_SNAKE_CASE		)]

                  # rotor rc --------------------------
                  snake_case__       :   Dict	      =    abc.index(__SCREAMING_SNAKE_CASE		) + rotorposa
                  snake_case__       :   Union[str, Any]	      =    rotora[index % len(__SCREAMING_SNAKE_CASE		)]

                  # reflector --------------------------
                  # this is the reason you don't need another machine to decipher

                  snake_case__       :   Dict	      =    reflector[symbol]

                  # 2nd rotors
                  snake_case__       :   str	      =    abc[rotora.index(__SCREAMING_SNAKE_CASE		) - rotorposa]
                  snake_case__       :   Optional[int]	      =    abc[rotora.index(__SCREAMING_SNAKE_CASE		) - rotorposa]
                  snake_case__       :   Tuple	      =    abc[rotora.index(__SCREAMING_SNAKE_CASE		) - rotorposa]

                  # 2nd plugboard
                  if symbol in plugboard:
                        snake_case__       :   int	      =    plugboard[symbol]

                  # moves/resets rotor positions
                  rotorposa += 1
                  if rotorposa >= len(__SCREAMING_SNAKE_CASE		):
                        snake_case__       :   str	      =    0
                        rotorposa += 1
                  if rotorposa >= len(__SCREAMING_SNAKE_CASE		):
                        snake_case__       :   Optional[int]	      =    0
                        rotorposa += 1
                  if rotorposa >= len(__SCREAMING_SNAKE_CASE		):
                        snake_case__       :   List[str]	      =    0

        # else:
        #    pass
        #    Error could be also raised
        #    raise ValueError(
        #       'Invalid symbol('+repr(symbol)+')')
            result.append(__SCREAMING_SNAKE_CASE		)

      return "".join(__SCREAMING_SNAKE_CASE		)


if __name__ == "__main__":
      A_			      =		"This is my Python script that emulates the Enigma machine from WWII."
      A_			      =		(1, 1, 1)
      A_			      =		"pictures"
      A_			      =		(rotora, rotora, rotora)
      A_			      =		enigma(message, rotor_pos, rotor_sel, pb)

      print("Encrypted message:", en)
      print("Decrypted message:", enigma(en, rotor_pos, rotor_sel, pb))






'''simple docstring'''






def 		UpperCamelCase__      (		__SCREAMING_SNAKE_CASE		)    ->   int:
      if n == 1 or not isinstance(__SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE		):
            return 0
      elif n == 2:
            return 1
      else:
            snake_case__       :   int	      =    [0, 1]
            for i in range(2				,      n + 1		):
                  sequence.append(sequence[i - 1] + sequence[i - 2]		)

            return sequence[n]






def 		UpperCamelCase__      (		__SCREAMING_SNAKE_CASE		)    ->   int:
      snake_case__       :   Optional[int]	      =    0
      snake_case__       :   Dict	      =    2

      while digits < n:
            index += 1
            snake_case__       :   Optional[int]	      =    len(str(fibonacci(__SCREAMING_SNAKE_CASE		)		)		)

      return index






def 		UpperCamelCase__      (		__SCREAMING_SNAKE_CASE = 1000		)    ->   int:
      return fibonacci_digits_index(__SCREAMING_SNAKE_CASE		)


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