Step 4 of 10 of the walkthrough. Nitrogen holds three bonds, so each one adds a half. Caffeine C8H10N4O2 reads 8 − 5 + 2 + 1 = 6, which the drawing spends on two rings and four pi bonds. The nitrogens paid for part of that and the oxygens paid for none of it. Delete a methyl group from the drawing and the 6 holds.
It opens on C8H10N4O2, with the calculator under it, so the arithmetic of this step is on screen while you read it.
A degree of unsaturation is rings plus pi bonds. Read it off a molecular formula, count it off a structure you draw, and compare the two: they part company whenever sulfur or phosphorus is drawn beyond the valence the formula assumes. The tool needs JavaScript; these are the pages it offers: