I am working with a .sty file, that defines a myheadings style like this:
\pagestyle{myheadings}
\markboth{}{header part 1~header part 2~\textendash~header part 3}
The pagestyle inserts a page number right of the header. I now would like to change the number from a plain number X to X of N. The other answers how to change the page numbers seem to define them in \cfoot, what doesn't match the myheadings style but only works with page numbers inside the footer.
I guess there is a simple command that that needs to be renewed such that the pagestyle automatically uses the correct format, but I cannot find which one.

