def get_len_single_middle_vertex(len_leading, len_middle, len_trailing):
  """Get the length of the resulting sequence if only one middle vertex is used.

  Args:
    len_leading: The length of the leading input n-grams.
    len_middle: The length of the middle input n-grams.
    len_trailing: The length of the trailing input n-grams.

  Returns:
    The length of a one middle vertex sequence.
  """
  return (max(len_leading, len_middle) + 1) + \
      (max(len_trailing, len_middle) + 1) - len_middle