output_description: Print the number of possible passwords.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
attempt: N, K = map(int, input().split())
  S = input()
  
  H0 = 0
  N_LR = 0
  N_RL = 0
  
  if S[0] == "R" and S[1] == "R":
      H0 += 1
  if S[0] == "R" and S[1] == "L":
      N_RL += 1
  if S[0] == "L" and S[1] == "R":
      N_LR += 1
  
  if S[N - 1] == "L" and S[N - 2] == "L":
      H0 += 1
  
  for i in range(1, N - 1):
      if S[i] == "L" and S[i - 1] == "L" or S[i] == "R" and S[i + 1] == "R":
          H0 += 1
      if S[i] == "R" and S[i + 1] == "L":
          N_RL += 1
      if S[i] == "L" and S[i + 1] == "R":
          N_LR += 1
  
  M = min(N_RL, N_LR, K)
  H1 = H0 + 2 * M
  K -= M
  N_RL -= M
  N_LR -= M
  
  result = H1 + min(K, max(N_RL, N_LR))
  print(result)
  
problem_description: Statement
  
  Takahashi is going to set a 3-character password.
  
  How many possible passwords are there if each of its characters must be a
  digit between 1 and N (inclusive)?
samples: [{"input": "2", "output": "8\n    \n\nThere are eight possible passwords: `111`, `112`, `121`, `122`, `211`, `212`,\n`221`, and `222`.\n\n* * *"}, {"input": "1", "output": "1\n    \n\nThere is only one possible password if you can only use one kind of character."}]