#C650. Taco Array Reduction

    ID: 50267 Type: Default 1000ms 256MiB

Taco Array Reduction

Taco Array Reduction

Given an array of positive integers, you are required to reduce this array to a single element by performing a series of operations.

In each operation, you remove any two elements and append their sum modulo \(10\) to the array. Note that every operation decreases the array length by one. Hence, if the array initially contains \(n\) elements, the minimum number of operations required to reduce the array to a single element is \(n - 1\).

Your task is to compute and output this number.

inputFormat

The first line of the input contains a single integer \(n\) (\(1 \leq n \leq 10^5\)) representing the number of elements in the array.

The second line contains \(n\) space-separated positive integers, representing the array elements.

outputFormat

Output a single integer: the minimum number of steps required to reduce the array to one element. As explained, this value is \(n - 1\) for an array of length \(n\).

## sample
4
3 8 4 1
3

</p>