The arithmetic, stated
lens, left one frame's depth of field, three frames subjectstep ≤ DoF × 0.7
Hyperfocal distance H = f² ⁄ (N·c) + f, where f is the focal length, N the f-number and c the circle of confusion for the sensor. For a focus distance s, the near limit is s(H − f) ⁄ (H + s − 2f) and the far limit s(H − f) ⁄ (H − s), infinite once s reaches H. In macro mode, where you know the magnification m rather than the distance, the depth of field is 2·N·c·(1 + m) ⁄ m², which already contains the effective-aperture growth.
The stacking step is one frame's depth of field times (1 − overlap), and the frame count is the subject depth divided by the step, plus one, so the first and last frames sit beyond the subject. Every free depth-of-field calculator stops at the first paragraph; the second is why this one exists.
Which circle of confusion?
The values here are the conventional ones for a print viewed at normal distance. If you inspect at 100 % on a 45-megapixel sensor, halve them — and expect the frame count to double. The calculator is a planning tool; the stacker's inspector is the judge.