Ambipolar diffusion of hydrogen gives an additional upward thrust to metals that diffuse in the atmosphere of Ap stars. Its quantitative effect on the build-up of abundance stratification due to atomic diffusion that produces the observed abundance anomalies in Ap stars has not been evaluated so far. The purpose of this work is to quantify this effect throughout the stratification process of metals inside the atmosphere. We used our code caratmotion to compute the time-dependent atomic diffusion of four metals (Mg, Ca, Si, and Fe) in the atmosphere of a main-sequence star with an effective temperature of $8\,500$\,K, which is a typical temperature of Ap stars. The results, including ambipolar diffusion of H, are compared to results obtained without this process. Our main result is that ambipolar diffusion must be included in any calculation of atomic diffusion in Ap star atmospheres, at least for stars with $T_ eff 10\,000$\,K. We show that this concerns all metals, even those that are well supported by the radiation field, such as Fe. The crucial role of the stellar mass-loss rate is confirmed; it remains a determining parameter that is constrained, but still free in our calculations. We also present 3D calculations of Ca distributions in magnetic atmospheres. Questioning the interest of systematic searches for stationary solutions (which can often only be reached after a long evolutionary process), we note that remarkable behaviour can occur during the transient phases of the stratification build-up.