#pragma GNU optimize("O3")
#pragma GNU optimize("unroll-loops")
#include <bits/stdc++.h>

using namespace std;
#define pb push_back
#define in insert
#define int long long
#define ll long long
#define inf 1000000000000000000
#define N 300000
int cnt[8], r[8];
int g(int n, int k){
    int res = 1;
    for(int i = 0; i < n; i++) res *= k;
    return res;
}
void tup(){
    int n, k; cin >> n >> k;
    vector<int> a(n);
    for(int &i: a) cin >> i;
    int ans = 0;
    for(int j = n - 1; j >= n - k; j--){
        ans += a[j];
    }
    ans += n;
    cout << ans;
}

signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    tup();
}