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: # -*- coding: utf-8 -*-
  """
  Created on Sat Mar 14 23:05:24 2020
  
  @author: Kanaru Sato
  """
  
  
  def rdndnt(a, b):
      la = len(a)
      lb = len(b)
      l = min(la, lb)
      n = 0
      for i in range(l):
          if a[la - 1 - i] != "?" and b[i] != "?":
              if a[la - 1 - i : la] == b[0 : i + 1]:
                  n = i + 1
              else:
                  break
          else:
              n = i + 1
      return n
  
  
  s = input()
  t = input()
  u = input()
  
  st = rdndnt(s, t)
  ts = rdndnt(t, s)
  tu = rdndnt(t, u)
  ut = rdndnt(u, t)
  us = rdndnt(u, s)
  su = rdndnt(s, u)
  
  stu = st + tu
  sut = su + ut
  tsu = ts + su
  tus = tu + us
  uts = ut + ts
  ust = us + st
  
  M = max(stu, sut, tsu, tus, uts, ust)
  ans = len(s) + len(t) + len(u) - M
  
  print(ans)
  
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."}]