#include <bits/stdc++.h>
#define int int64_t
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
using namespace std;



signed main() {
    int n, k; cin >> n >> k;

    vector<int> a(n);


    for (int &i : a)
        cin >> i;

    // reverse(all(a));

    int sum = 0;

    for (int i = 0; i < k; i++)
        sum += a[i] + 1;

    // sum += n - k;

    cout << sum;
}