Artificial intelligent assistant

Ratio problem to find the woman weekly salary A woman spend $5/8$ of her weekly salary on rent, and $1/3$ of the remainder on food, leaving $40 available for other expenses. What is the woman's weekly salary ? I have tried , i am really confused with finding remainder.

Let $x$ be her weekly salary. She spends $\frac58x$ on rent; the remainder is what’s left, so the remainder is $x-\frac58x=\frac38x$. She spends $\frac13$ of that, or $\frac13\cdot\frac38x=\frac18x$, on food; that leaves $\frac38x-\frac18x=\frac14x$ for other expenses. Can you finish it now?

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy a699cf163b28c6a2c759172fc0332042