Sroud loves to play PUBG and does programming contest. He always thinks about converting gameplay to programming, and most of the times he gets weird idea. The problem mentioned below is the output of one of those weird ideas.
In PUBG there are several play zones, and players should cross these play zones from starting to final play zone by car (if he has one) or by running. But in this special weird idea, one always has a car with him. But there are some weird instructions also to drive a car.
Now, Sroud is excited to find the size of path one has to cover by running to cross each play zone from starting to final play zone.
Input starts with an Integer () and () denoting the number of play zones and the size of path a car moves forward by pressing the button mentioned above.
Second line contains space separated integers , , ..., , where () denotes the size of the -th play zone.
Print an integer — denoting the size of path one has to cover by running.
Input | Output |
---|---|
3 8 4 10 1 | 7 |