Titration of chemisorbed oxygen by hydrogen on Ru(001)