output_description: Print the maximum number of coins you can get.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      A B
attempt: def init(a):
      cf = a[0]
      cc = 0
      z = []
      for it in a:
          if it == cf:
              cc += 1
          else:
              if cf == "0":
                  z.append(-cc)
              else:
                  z.append(cc)
              cf = it
              cc = 1
      z.append(cc)
      return z
  
  
  p = []
  
  
  def solve(a, K):
  
      if K == 0:
          p.append(max(a))
          return
      N = len(a)
      if K % 2 == 0:
          if a[0] > 0:
              b = []
              b.append(a[1] - a[0])
              for j in range(2, N):
                  b.append(a[j])
              solve(b, K - 1)
          if a[N - 1] > 0:
              b = []
              for j in range(2, N):
                  b.append(a[j])
              b.append(a[N - 2] - a[N - 1])
              solve(b, K - 1)
          for i in range(1, N - 1):
              if a[i] > 0:
                  b = []
                  for j in range(0, i - 1):
                      b.append(a[j])
                  b.append(a[i - 1] - a[i] + a[i + 1])
                  for j in range(i + 2, N):
                      b.append(a[j])
                  solve(b, K - 1)
      else:
          if a[0] < 0:
              b = []
              b.append(a[1] - a[0])
              for j in range(2, N):
                  b.append(a[j])
              solve(b, K - 1)
          if a[N - 1] < 0:
              b = []
              for j in range(2, N):
                  b.append(a[j])
              b.append(a[N - 2] - a[N - 1])
              solve(b, K - 1)
          for i in range(1, N - 1):
              if a[i] < 0:
                  b = []
                  for j in range(0, i - 1):
                      b.append(a[j])
                  b.append(a[i - 1] - a[i] + a[i + 1])
                  for j in range(i + 2, N):
                      b.append(a[j])
                  solve(b, K - 1)
  
  
  N, K = list(map(int, input().split(" ")))
  a = str(input())
  z = init(a)
  L = len(a)
  Q = 0
  if z[0] < 0:
      Q = N // 2 + 1
  else:
      Q = N // 2
  if K >= Q:
      print(N)
  else:
  
      solve(z, K)
      print(max(p))
  
problem_description: Statement
  
  There are two buttons, one of size A and one of size B.
  
  When you press a button of size X, you get X coins and the size of that button
  decreases by 1.
  
  You will press a button twice. Here, you can press the same button twice, or
  press both buttons once.
  
  At most how many coins can you get?
samples: [{"input": "5 3", "output": "9\n    \n\nYou can get 5 + 4 = 9 coins by pressing the button of size 5 twice, and this\nis the maximum result.\n\n* * *"}, {"input": "3 4", "output": "7\n    \n\n* * *"}, {"input": "6 6", "output": "12"}]