Complete formula perser with variable counting