import re


def count_expr_arity(str_desc):
    """ Determine the arity of an expression directly from its str
        descriptor """
    # we start by extracting all words in the string
    # and then count the unique occurence of words matching "x", "y", "z" or "t"
    return len(set(var for var in re.findall("\w+", str_desc) if re.fullmatch("[xyzt]", var)))