#include <bits/stdc++.h>

using namespace std;
using ll = long long;

constexpr ll INF = 1e9 + 5;

void solve() {
    ll n, k;
    cin >> n >> k;
    vector<ll> a(n - 1);
    for (ll i = 0; i < n - 1; ++i) {
        cin >> a[i];
    }

    ll ans;
    cin >> ans;
    ans += n;
    sort(a.begin(), a.end());
    for (ll i = 0; i < k - 1; ++i) {
        ans += a[n - 2 - i];
    }
    cout << ans << '\n';
}

signed main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    ll t = 1;
    //cin >> t;
    while (t--) {
        solve();
    }
}
