  Given a graph $H$ and a set of graphs $\mathcal F$, let $ex(n,H,\mathcal F)$
denote the maximum possible number of copies of $H$ in an $\mathcal F$-free
graph on $n$ vertices. We investigate the function $ex(n,H,\mathcal F)$, when
$H$ and members of $\mathcal F$ are cycles. Let $C_k$ denote the cycle of
length $k$ and let $\mathscr C_k=\{C_3,C_4,\ldots,C_k\}$. Some of our main
results are the following.
  (i) We show that $ex(n, C_{2l}, C_{2k}) = \Theta(n^l)$ for any $l, k \ge 2$.
Moreover, we determine it asymptotically in the following cases: We show that
$ex(n,C_4,C_{2k}) = (1+o(1)) \frac{(k-1)(k-2)}{4} n^2$ and that the maximum
possible number of $C_6$'s in a $C_8$-free bipartite graph is $n^3 +
O(n^{5/2})$.
  (ii) Solymosi and Wong proved that if Erd\H{o}s's Girth Conjecture holds,
then for any $l \ge 3$ we have $ex(n,C_{2l},\mathscr
C_{2l-1})=\Theta(n^{2l/(l-1)})$. We prove that forbidding any other even cycle
decreases the number of $C_{2l}$'s significantly: For any $k > l$, we have
$ex(n,C_{2l},\mathscr C_{2l-1} \cup \{C_{2k}\})=\Theta(n^2).$ More generally,
we show that for any $k > l$ and $m \ge 2$ such that $2k \neq ml$, we have
$ex(n,C_{ml},\mathscr C_{2l-1} \cup \{C_{2k}\})=\Theta(n^m).$
  (iii) We prove $ex(n,C_{2l+1},\mathscr C_{2l})=\Theta(n^{2+1/l}),$ provided a
strong version of Erd\H{o}s's Girth Conjecture holds (which is known to be true
when $l = 2, 3, 5$). Moreover, forbidding one more cycle decreases the number
of $C_{2l+1}$'s significantly: More precisely, we have $ex(n, C_{2l+1},
\mathscr C_{2l} \cup \{C_{2k}\}) = O(n^{2-\frac{1}{l+1}}),$ and $ex(n,
C_{2l+1}, \mathscr C_{2l} \cup \{C_{2k+1}\}) = O(n^2)$ for $l > k \ge 2$.
  (iv) We also study the maximum number of paths of given length in a
$C_k$-free graph, and prove asymptotically sharp bounds in some cases.
