EasyRating 800
Lift Travel
A lift starts on floor 0 and visits the floors in the order given. How many floors does it travel in total?
Input
n, then n floors.
Output
The total distance.
Sample 1
Input
3 5 2 8
Output
14
Sample 2
Input
1 0
Output
0
Output appears here