#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

#define ll long long

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll n, k;
    cin >> n >> k;
    vector<ll> a(n);
    for (ll i = 0; i < n; i++) {
        cin >> a[i];
    }
    ll answer = 0;
    for (ll i = 0; i < k; i++) {
        answer += a[n - 1 - i];
    }
    cout << answer + n;
}