#include <bits/stdc++.h>

using namespace std;

using ll = long long;

void solve() {
    int n, k;
    cin >> n >> k;
    vector<ll> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    ll ans = 0;
    reverse(a.begin(), a.end());
    for (int i = 0; i < k; i++) {
        ans += a[i];
    }
    cout << ans + n;
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int T = 1;
    //cin >> T;
    while (T--) {
        solve();
        cout << '\n';
    }
    return 0;
}
