#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//using namespace std;
//template <class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
using ll = long long;
using namespace std;
#define all(a) a.begin(), a.end()
void solve() {
    int n, k;
    cin >> n >> k;
    vector<ll> a(n);
    for (auto &i : a) cin >> i;
    sort(all(a));
    ll ans = 0;
    for (int i = n - 1; i >= n - k; --i) {
        ans += a[i];
    }
    cout << ans + n << '\n';
}

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