LearnPy Hub
← Arena
IntermediateRating 1200

Elevator Trips

An elevator starts at floor 0, moves 1 floor per second and stops for 5 seconds at each requested floor, visited in the given order. Print the total time.

Input

n, then n floors.

Output

Seconds.

Sample 1

Input
3
5 2 8
Output
29

Sample 2

Input
1
0
Output
5
solution.py
Output appears here
Elevator Trips · Python Arena problem · LearnPy Hub