OK, this one is a little trickier, but MS can solve it. The first thing to realize is that the MS "=" operator is not really an equality operator in the sense of your above example, but a subsittution operator.
So in Mathematica, one can say x == y; x == z; and x == p; which means that x,y,z, and p are all equal.
If you were to do this in MS:
x=y; x=z; x=p;
x is now equal to "p", having replaced the value of x first with "y", then "z", and the last one "p".
So how to solve the original problem? Here is one way, similar to the way one would do it manually, but letting MS do the actual algebra.
There are other ways to handle this problem in MS, but I think this gives you the idea.