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()))
  
  
  def f(s, t):
      # print(s,t)
      for i, j in zip(s, t):
          if i == j or i == "?" or j == "?":
              pass
          else:
              return False
      else:
          return True
  
  
  def calc(a, c):
      l = 0
      r = len(a) * 2 + 1
      while r - l > 1:
          m = (l + r) // 2
          if f(a[-m:], c[:m]):
              l = m
          else:
              r = m
          # print(l,m,r)
      return l
  
  
  ans = len(a) + len(b) + len(c)
  max_ = 0
  for case in [((b, a), (a, c)), ((a, b), (a, c))]:
      s = 0
      for i, j in case:
          s += (calc(i, j)) // 2
      max_ = max(max_, s)
  print(ans - max_)
  
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."}]