We give a new proof - not using resolution of singularities - of a formula of Denef and the second author expressing the Lefschetz number of iterates of the monodromy of a function on a smooth complex algebraic variety in terms of the Euler characteristic of a space of truncated arcs. Our proof uses l-adic cohomology of non-archimedean spaces, motivic integration and the Lefschetz fixed point formula for finite order automorphisms. We also consider a generalization due to Nicaise and Sebag and at the end of the paper we discuss connections with the motivic Serre invariant and the motivic Milnor fiber.