  Given a fixed graph $H$ that embeds in a surface $\Sigma$, what is the
maximum number of copies of $H$ in an $n$-vertex graph $G$ that embeds in
$\Sigma$? We show that the answer is $\Theta(n^{f(H)})$, where $f(H)$ is a
graph invariant called the `flap-number' of $H$, which is independent of
$\Sigma$. This simultaneously answers two open problems posed by Eppstein
(1993). When $H$ is a complete graph we give more precise answers.
