Atomic-layer titration of surface reactions