For example,
consider a mountain whose summit is 5,000 feet (1,500 m) in elevation, but somewhere on the way up, the trail goes back down 250 feet (76 m). ...
If one hikes over five hills of 100 vertical feet each, the cumulative elevation gain is 5 × (100 feet (30 m)) = 500 feet (150 m).