import 'dart:io';
import 'dart:math';

void main(){
	int n, d, ans = 0;
	var arr;
	List<int> l = stdin.readLineSync().split(" ").map((e) => int.parse(e)).toList();
	n = l[0];
	d = l[1];
	l = stdin.readLineSync().split(" ").map((e) => int.parse(e)).toList();
	while(d > 0){
		l.sort((b, a) => a.compareTo(b));
		int temp = l[0];
		l.remove(temp);
		l.add(temp~/2);
		d -= 1;
	}
	for(int i in l){
		ans += i;
	}
	print(ans);
}