#include<iostream>
#include<algorithm>
#include<math.h>
using namespace std;

long long a[100005];

int main()
{
	int n, m;
	long long ans = 0;
	cin >> n >> m;
	for (int i = 1; i <= n; i++)
		cin >> a[i];

	sort(a + 1, a + 1 + n);

	if (n == 1)
	{
		for (int i = 1; i <= m; i++)
			a[1] /= 2;
		cout << a[1] << endl;
		return 0;
	}

	for (int cnt = 0, i = n; cnt < m;)
	{
		if (a[i] >= a[i - 1])
		{
			a[i] /= 2;
			cnt++;
			if (i > 0 && a[i] < a[i - 1])
			{
				i--;
			}
			else
				i = n;
		}
	}
	for (int i = 1; i <= n; i++)
		ans += a[i];
	cout << ans << endl;
	return 0;
}