# Show sheet number in LaTeX

I want to show the sheet number instead page number in the header of odd pages, but it always shows 1:

\documentclass[twoside]{article}

\usepackage{calc}
\usepackage{titleps}

\newcounter{sheet}
\renewcommand*{\thesheet}{\arabic{sheet}}
\setcounter{sheet}{(\thepage+1)/2}

\newpagestyle{mypagestyle}{
[][][] % even
{}{Sheet \thesheet}{} % odd
}
\pagestyle{mypagestyle}

\begin{document}

First page
\clearpage
Second page
\clearpage
Third page

\end{document}


How can I fix this?

PS: It is important not to modify the \thepage counter to avoid conflicts with other packages.

That's because the sheet counter is never incremented with the page counter. Moreover, \thepage could be defined as something other than \arabic{page} and therefore not be a number (use \value{page} in calculations). Regardless, just set the sheet calculation directly in the header via \numexpr:
\newpagestyle{mypagestyle}{