#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 sum = k;
    for (int i = n - 1; i >= n - k; i--) {
        sum += a[i];
    }
    cout << sum + n - k;
}

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