W = int(input()) N = int(input()) blo = sorted(list(map(int,input().split()))) s=0 for i in range(N): s+=blo[i] if i+1