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 = input().strip()
  b = input().strip()
  c = input().strip()
  kk = 2000
  K = kk * 2
  na, nb, nc = len(a), len(b), len(c)
  
  
  def ll(s, t):
      X = [0] * 100000
      ns, nt = len(s), len(t)
      for i in range(ns):
          for j in range(nt):
              if s[i] != t[j] and s[i] != "?" and t[j] != "?":
                  X[i - j + 2 * K] = 1
      return X
  
  
  ab = ll(a, b)
  bc = ll(b, c)
  ac = ll(a, c)
  r = na + nb + nc
  for i in range(-K, K + 1):
      for j in range(-K, K + 1):
          if (not ab[i + 2 * K]) and (not ac[j + 2 * K]) and (not bc[j - i + 2 * K]):
              st = min(i, j, 0)
              en = max(i + nb, j + nc, na)
              r = min(en - st, r)
  print(r)
  
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."}]