Ties#7299

Ties

0.1 seconds
64 megabytes
Very easy

At the opening of the "Tournament of Champions," members of the jury must address the participants and guests. To emphasize the unity of all jury representatives, it has been decided that they will all wear ties of the same color. All the ties are kept in a chest in a dark room, and each tie has one of colors. The room can be entered only once, and you may take any number of ties from the chest and bring them out. You must determine the minimum number of ties you need to take from the chest to guarantee that among them there are at least ties of the same color.

Input

The program reads two lines from the standard input. The first line contains two integers and (1 \leq N \leq 10^6, 1 \leq M \leq 10^4). The second line contains integers, each representing the number of ties of the corresponding color. All numbers are non-negative integers not exceeding 10^9.

Output

The program should output to the standard output a single number — the minimal number of ties that must be taken from the chest. If it is impossible to guarantee having ties of the same color, output .

Examples

Example 1

Loading
Loading