#K72182. Minimum Operations to Reduce Array Length

    ID: 33697 Type: Default 1000ms 256MiB

Minimum Operations to Reduce Array Length

Minimum Operations to Reduce Array Length

You are given an array of n integers. In one operation, you can remove any one element from the array, which reduces its size by 1. Your task is to compute the minimum number of operations required to reduce the array's length to 1.

Since the array initially has n elements, you need to perform exactly $$n-1$$ operations to reduce it to a single element. The values of the array elements are not important, only the count matters.

inputFormat

The input is provided via standard input (stdin) in the following format:

The first line contains a single integer n representing the number of elements in the array.
The second line contains n space-separated integers representing the elements of the array.

outputFormat

Output a single integer to standard output (stdout) representing the minimum number of operations required to reduce the array's length to 1.

## sample
4
1 2 3 4
3