#include <iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;
int a[100005];
void siftdown(int a[], int i, int n)
{
	int j;
	int t = a[i];
	while ((j = 2 * i + 1) < n)
	{
		if (j < n - 1 && a[j] < a[j + 1])
			j++;
		if (t < a[j])
		{
			a[i] = a[j];
			i = j;
		}
		else break;
	}
	a[i] = t;
}
void heap_sort(int a[], int n)
{
	int i;
	int t;
	for (i = (n - 2) / 2; i >= 0; i--)
		siftdown(a, i, n);
	for (i = n - 1; i > 0; i--)
	{
		t = a[0];
		a[0] = a[i];
		a[i] = t;
		siftdown(a, 0, i);
	}
}
int main()
{
	int n, m;
	long long ans = 0;
	cin >> n >> m;
	for (int i = 0; i < n; i++)
		cin >> a[i];
	heap_sort(a, n);
	/*while (m--)
	{
		a[n - 1] /= 2;
		heap_sort(a, n);
	}*/
	for (int i = 0; i < n; i++)
		ans += a[i];
	cout << ans;
	return 0;
}

