Given the cost of each step, find the minimum cost to reach the top.
Input Format
Integer n n space-separated integers (cost of each step)
Output Format
Minimum total cost
Sample Input
4 10 15 20 5
Sample Output
15
Given the cost of each step, find the minimum cost to reach the top.
Integer n n space-separated integers (cost of each step)
Minimum total cost
4 10 15 20 5
15