#include <iostream>
#include <vector>
#include <set>
#include <cmath>
#include <algorithm>

using namespace std;

using ll = long long;

#pragma GCC optimaze("Ofast");

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll n, k;
	cin >> n >> k;
	vector<ll> a(n);
	for (int i = 0; i < n; i++) cin >> a[i];
	reverse(a.begin(), a.end());
	ll su = 0;
	for (int i = 0; i < k; i++) su += a[i];
	cout << su + n;
}



