P1897 The Awkwardness in the Elevator

Background

Careful students have noticed that lately, Xiao W likes to ride the elevator up and down. As for the reason, perhaps only Xiao W knows: in the elevator, he often runs into the OI “da shen” lxl in his heart. The elevator is actually a magical place. Only in the elevator does Xiao W have the courage to get so close to the “da shen.” Although he feels a bit uneasy, after many encounters, the “da shen” has gotten used to Xiao W’s presence, even to the point where it feels inappropriate not to say something. However, their conversation is limited to things like “Nice weather today” or “Have you eaten?”, and often, after a polite smile and nod, they fall back into an awkward silence.

Description

So, while trying to strike up a conversation with the “da shen,” Xiao W also watches the floor number displayed in the elevator. He notices that going up one floor takes $6$ seconds, going down one floor takes $4$ seconds, each door opening takes $5$ seconds (only if someone arrives and the elevator stops), and each person getting off adds $1$ second. It is specifically stated that the elevator starts on floor $0$, and it must return to floor $0$ at the end for the trip to be considered finished. Assuming that at the beginning we know the destination floor of every person currently inside the elevator, can you compute the total time needed to complete this trip? This is a very simple problem. You should know that Xiao W has already trained himself to quickly do the mental arithmetic. Now you try to program it!

Input Format

There are $2$ lines. The first line contains a positive integer $n$, the number of people riding the elevator. The second line contains $n$ positive integers. $a_{i}$ denotes the destination floor of the $i$-th person.

Output Format

Output one line containing a positive integer — the time needed to complete this trip.

Explanation/Hint

For $60\%$ of the testdata, $0