The adsorption of a water molecule on the (001) surface of SrTiO3 is studied by ab initio molecular-dynamics simulations. The microscopic process of the dissociative adsorption near a surface oxygen vacancy is examined by the population analysis in detail. Also, the dynamic behavior of a proton near the (001) surfaces of SrTiO3 and SrCeO3 is investigated. It is shown that dopant ions near the surface are influential for the proton absorption.