output_description: Print the minimum possible length of s.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      a
      b
      c
attempt: a = list(input())
  b = list(input())
  c = list(input())
  n0 = len(a)
  n1 = len(b)
  n2 = len(c)
  al = []
  
  
  def mae(a, b):
      n0 = len(a)
      n1 = len(b)
      al = []
      now = []
      count = 0
      for i in range(n1):
          if a[0] == b[i] or a[0] == "?" or b[i] == "?":
              now2 = now
              count2 = 0
              for j in range(min(n1 - i, n0)):
                  if a[j] != b[j + i] and a[j] != "?" and b[j + i] != "?":
                      break
                  else:
                      count2 += 1
                      now2.append(a[j])
              count = max(count, count2)
              al.append([now2, count2])
          now.append(b[i])
      return al, count
  
  
  def ushiro(a, b):
      n0 = len(a)
      n1 = len(b)
      al = []
      now = []
      count = 0
      for i in range(n1 - 1, -1, -1):
          if a[n0 - 1] == b[i] or a[n0 - 1] == "?" or b[i] == "?":
              now2 = now
              count2 = 0
              for j in range(min(i, n0)):
                  if (
                      a[n0 - 1 - j] != b[i - j]
                      and a[n0 - 1 - j] != "?"
                      and b[i - j] != "?"
                  ):
                      break
                  else:
                      count2 += 1
                      now2.append(a[j])
              count = max(count, count2)
              al.append([now2, count2])
          now.append(b[i])
      return al, count
  
  
  ansl = []
  c1, k = mae(a, b)
  c2, p = ushiro(a, b)
  for i in c1:
      c3, k1 = mae(c, i[0])
      ansl.append(k1 + i[1])
  for i in c2:
      c3, k1 = ushiro(c, i[0])
      ansl.append(k1 + i[1])
  c1, k = mae(b, a)
  c2, p = ushiro(b, a)
  for i in c1:
      c3, k1 = mae(c, i[0])
      ansl.append(k1 + i[1])
  for i in c2:
      c3, k1 = ushiro(c, i[0])
      ansl.append(k1 + i[1])
  c1, k = mae(a, c)
  c2, p = ushiro(a, c)
  for i in c1:
      c3, k1 = mae(b, i[0])
      ansl.append(k1 + i[1])
  for i in c2:
      c3, k1 = ushiro(b, i[0])
      ansl.append(k1 + i[1])
  c1, k = mae(c, a)
  c2, p = ushiro(c, a)
  for i in c1:
      c3, k1 = mae(b, i[0])
      ansl.append(k1 + i[1])
  for i in c2:
      c3, k1 = ushiro(b, i[0])
      ansl.append(k1 + i[1])
  c1, k = mae(c, b)
  c2, p = ushiro(c, b)
  for i in c1:
      c3, k1 = mae(a, i[0])
      ansl.append(k1 + i[1])
  for i in c2:
      c3, k1 = ushiro(a, i[0])
      ansl.append(k1 + i[1])
  c1, k = mae(b, c)
  c2, p = ushiro(b, c)
  for i in c1:
      c3, k1 = mae(a, i[0])
      ansl.append(k1 + i[1])
  for i in c2:
      c3, k1 = ushiro(a, i[0])
      ansl.append(k1 + i[1])
  print(n0 + n1 + n2 - max(ansl))
  
problem_description: Statement
  
  Snuke has a string s. From this string, Anuke, Bnuke, and Cnuke obtained
  strings a, b, and c, respectively, as follows:
  
    * Choose a non-empty (contiguous) substring of s (possibly s itself). Then, replace some characters (possibly all or none) in it with `?`s.
  
  For example, if s is `mississippi`, we can choose the substring `ssissip` and
  replace its 1-st and 3-rd characters with `?` to obtain `?s?ssip`.
  
  You are given the strings a, b, and c. Find the minimum possible length of s.
samples: [{"input": "a?c\n    der\n    cod", "output": "7\n    \n\nFor example, s could be `atcoder`.\n\n* * *"}, {"input": "atcoder\n    atcoder\n    ???????", "output": "7\n    \n\na, b, and c may not be distinct."}]