So I'm writing an exam. It will have some as-yet-unknown number of pages P, and an additional 3 pages of a formula sheet. So the total length is N = P +3.
I need to write "This exam has $P$ pages, plus $3$ pages of formulas, for a total of $N$ pages".
I currently have a label at the end of the exam: \label{lastpage}, and so where I have P, I can write\pageref{lastpage}`.
But is there some way I can get N to be calculated automatically for me? I suspect it might exist in pgfmath, but I haven't used it in a while.

\the\numexpr(\ztotpages)+3\relax). – Sep 04 '19 at 01:38\def\mynum{3}and then\the\numexpr(\ztotpages)+\mynum\relax. (Some users on this site have a very strange behavior I must say.) – Sep 04 '19 at 03:47