#include <bits/stdc++.h>


using namespace std;


using ll = long long;


template<typename T>
ostream & operator <<(ostream &os, const vector<T> &a) {
    for (T el : a) {
        os << el << " ";
    }
    os << '\n';
    return os;
}


int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, k;
    cin >> n >> k;
    vector<ll> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a.at(i);
    }
    sort(a.begin(), a.end());
    ll ans = 0;
    for (int i = n - 1; i >= n - k; i--) {
        ans += a.at(i);
    }
    cout << ans + n;
    return 0;
}
