Hey there! I'm happy to help!
Let's think of this as one giant rectangle. We see that a little bit is cut out, but we will ignore that for now.
The width of this rectangle is 10 ft.
The length is 12+5+8 feet which is 25 feet. (we have the lengths of 12 and 8 on the top and the length of 5 is below, but it matches the missing length at the top).
We multiply the width by the length to find the area of this huge rectangle.
10*25=250
Now, we need to cut out that square that isn't actually part of the room. We see that it's dimensions are 5 ft by 5 ft, so 25 ft. All we have to do is subtract this from the huge rectangle we calculated.
250-25=225
So, Mary needs 225 square feet of carpet.
Have a wonderful day and keep on learning! :D