Detect whether input is a formula or anything else.