SIMPLE MATH? isn't so simple with flash?

I was thinking, how do you do a simple math equasion… or not so simple…

say I had 4 imput texts, and I wanted to have them add up and give me the total cost in another imput text… how would I do that, I’m thinking though, If say ordering six muffins cost $12 dollars, and ordering 12 muffins cost $20 dollars, how would you do that, if 6 then $12 if 12 then $20 THEN if 18 then $32? like see my problem, i’d have to work out every variable right?

oh well even if nobody knows what im talking about, could someone direct me to math with flash?