Counting Terms In Algebraic Expressions