Glad you got that worked out.
Just FYI:
The assignment operator ("=") isn't the same as the equals sign in mathematics. This is very important.
It only works one way. whatever value that is on the right once calculated will be added to the left. This works the same way for many things. Imagine if you used the input operator for the cout statement the way you used the assignment operator:
"Hi ">> "There" >> cout;
This would absolutely not work. so just get used to this aspect of programming. In almost all English versions of programming languages. the math (adding, sub, mult.) is done on the right and then assigned to the left. This is universal.