Aliens' Socks

No attempts yetTime limit1sMemory limit1024 MB

Problem

An alien ship landed in Bitland. The aliens were especially charmed by Bitland's fashionable socks. Since each alien has $k$ legs, they bought a great many socks in various colors.

The alien Bronius has $s$ different colors of socks in his drawer, and he knows how many socks he has of each color. Every morning, without looking into the drawer, Bronius draws socks one at a time until he holds $k$ socks of the same color.

This morning Bronius is in a great hurry and wants to know: at least how many socks must he draw from the drawer to be certain that he holds at least $k$ socks of one color?

Input

The first line contains two positive integers: the number of Bronius's legs $k$ and the number of sock colors in the drawer $s$.

The second line contains $s$ positive integers $n_i$, the number of socks of the $i$-th color in Bronius's drawer.

Output

Print one positive integer — the minimum number of socks Bronius must draw. Bronius will always be able to draw enough socks.

Constraints

  • $1 \le k \le 1000$
  • $1 \le s \le 1000$
  • $1 \le n_i \le 1000$ for all $i$