Five friends P, Q, X, Y and Z purchased some notebooks. The relevant information is given below:
- Z purchased 8 notebooks more than X did.
- P and Q together purchased 21 notebooks.
- Q purchased 5 notebooks less than P did.
- X and Y together purchased 28 notebooks.
- P purchased 5 notebooks more than X did.
If each notebook is priced Rs 40, then what is the total cost of all the notebooks?