Add Page X of Y to a Google Docs Footer

A footer such as “Page 3 of 12” needs two automatic elements in Google Docs: the current page number and the total page count. Typing the total manually creates an avoidable maintenance task whenever the document changes.