Chef is planning a huge party for all of you and has ordered M pizzas. He wants to invite as many people to the party. However, he knows that everyone will have exactly one slice of a pizza (regardless of the size) and he wants to make sure that he has enough pizza slices. 
Chef is very lazy and will only make a total of N straight cuts among all the pizzas. Each pizza is also of different size and to avoid the slices getting too small the chef can only make a max of Ai cuts to the ith pizza. He wants to maximize the number of slices of pizza. Since chef is busy with preparing other aspects of the party he wants you to find out the maximum number of slices he can get following the constraints. 
If a pizza is not cut at all then it is considered as 1 slice.  

-----Input-----
First line contains two integers M and N.
The second line of input contains the array A.

-----Output-----
Output a single integer - the maximum number of slices chef can get.

-----Constraints-----
- 1 ≤ M ≤ 2*105
- 1 ≤ N,Ai ≤ 2*105

-----Subtasks-----
- Subtask 1: 1 ≤ M,N ≤ 100 - 10 points 
- Subtask 2: 1 ≤ N ≤ 100, 
1 ≤ M ≤ 105 - 20 points
- Subtask 3: Original Constraints - 70 points

-----Example-----
Input:
5 10
1 2 3 4 5
Output:
31

-----Explanation-----
Example case 1. One of the optimal way to cut would be to do {0, 1,  0, 4, 5} cuts.

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = 'n,m=map(int,input().split())\nslices=[int(x) for x in input().split()]\nslices.sort()\narray=[0]*(slices[-1]+1)\narray[0]=1\nfor i in range(1,len(array)):\n    array[i]=array[i-1]+i\ntotal=0\nslices=slices[::-1]\nvalue=0\nfor i in range(len(slices)):\n    if slices[i]<=m:\n        total+=array[slices[i]]\n        m-=slices[i]\n        continue\n    if m<slices[i]:\n        total+=array[m]\n        m=0\n        value=len(slices)-i-1\n        break\ntotal+=value\nprint(total)\n    \n'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13321