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 = list(input())
  
  RL = 0
  LR = 0
  
  fo = 0
  
  if n < 3:
      if n == 1:
          print(0)
      else:
          print(1)
  
  else:
      for i in range(n):
          if s[i] == "R" and i < n - 1:
              if s[i + 1] == "R":
                  fo += 1
          if s[i] == "L" and 0 < i:
              if s[i - 1] == "L":
                  fo += 1
  
          if i < n - 1:
              if s[i] == "R" and s[i + 1] == "L":
                  RL += 1
              elif s[i] == "L" and s[i + 1] == "R":
                  LR += 1
  
      si = min(k, RL, LR)
      no = k - si
      LR_rest = LR - si
      RL_rest = RL - si
      if no == 0:
          ans = fo + si * 2
      else:
          ans = fo + si * 2
          if s[0] == "L":
              if LR_rest > 0:
                  ans += 1
                  LR_rest -= 1
                  no -= 1
          if no > 0:
              if s[-1] == "R":
                  if LR_rest > 0:
                      ans += 1
      print(ans)
  
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."}]