def find_matching_close_paren_idx(lst):
  """Assumes input list starting with '(', finds matching ')' and returns it's index.
    If not found, returns -1."""
  tgtcount = 0
  tgtidx = -1
  for idx in range(len(lst)):
    if lst[idx] == ')':
      tgtcount -= 1
    elif lst[idx] == '(':
      tgtcount += 1
    if tgtcount < 1:
      tgtidx = idx
      break
  return tgtidx