In a mystical realm, a warrior named Arlen is tasked with defending the land from ferocious beasts. To protect the realm, Arlen must eliminate every single beast. Arlen has two types of attacks:
The input consists of the following lines:
The input will be read from the STDIN by the candidate.
Print the minimum number of attacks required for Arlen to defeat all the beasts in the realm. The output will be matched to the candidate's output printed on STDOUT.
Input: $4$ $1 3 1 1$ Output: $4$
In the first test case, we can use an attack of the Basic Strike on the 1st, 3rd and 4th hordes, and one Ultimate Cleave on the second, for a total of $4$ attacks.