The airplane is flying at a certain altitude. When it drops, its altitude is lowered, so mathematically you subtract the number of feet it drops from the altitude it was cruising at. The number of feet it climbs is added to the altitude after it dropped, and so forth.
As an example say it's cruising at 35000 feet which is a pretty standard altitude for a cross-country flight. It drops 300 feet, then you have 35000 - 300 = 34700. Then say it climbs 200 feet, so your new altitude would be 34700 + 200 = 34900. Then it drops a 100 feet and you have 34900 - 100 = 34800.