def get_matching_paren(exp: str) -> int:
    """ Returns the index of the right parenthesis which matches the first left parenthesis.
        exp[0] should be a left parenthesis
    """
    if exp[0] != '(':
        raise ValueError('Given string must begin with \'(\' character')
    left = 1
    right = 0
    i = 1
    while left > right:
        if exp[i] == '(':
            left += 1
        elif exp[i] == ')':
            right += 1
        i += 1
    return i - 1