  We prove that for each odd integer $k \geq 7$, every graph on $n$ vertices
without odd cycles of length less than $k$ contains at most $(n/k)^k$ cycles of
length $k$. This generalizes the previous results on the maximum number of
pentagons in triangle-free graphs, conjectured by Erd\H{o}s in 1984, and
asymptotically determines the generalized Tur\'an number
$\mathrm{ex}(n,C_k,C_{k-2})$ for odd $k$. In contrary to the previous results
on the pentagon case, our proof is not computer-assisted.
