We use the Schwinger-Keldysh formalism to derive the charge counting statistics of an adiabatic pump based on an open quantum dot. The distribution function of the transmitted charge in terms of the time-dependent S matrix is obtained. It is applied to a few simple examples of the pumping cycles. By a chiral gauge transformation the problem is mapped onto a problem of pumping by voltage pulses. The role of the chiral anomaly arising in this mapping is emphasized. Conditions for the ideal noiseless quantized pump are discussed.