#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;

using ll = long long;

void solve() {
    ll n, m;
    cin >> n >> m;
    vector <ll> a(n, 0), x(m);
    for (int i = 0; i < m; ++i) {
        cin >> x[i];
    }
    multiset <ll> s;
    for (auto i : a) {
        s.insert(i);
    }
    //cout << x[0] << ' ';
    for (int i = 0; i < m; ++i) {
        /*if (i > 0)
            cout << x[i] - x[i - 1] << ' ';*/
        ll t1 = *s.begin(), t2 = *(--s.end());
        if (t2 - x[i] > x[i] - t1 && i != m - 1) {
            s.extract(t2);
            t2 = x[i] - t2;
            s.insert(t2);
         } else {
            s.erase(s.begin());
            t1 = x[i] - t1;
            s.insert(t1);
        }
        /*for (auto j : s) {
            cout << j << ' ';
        }
        cout << '\n';*/
    }
    ll ans = 0;
    for (auto i : s) {
        //cout << i << ' ';
        ans += i;
    }
    cout << '\n';
    cout << ans;
}

void solve1() {
    ll n, m;
    cin >> n >> m;
    vector <ll> a(n, 0), x(m);
    for (int i = 0; i < m; ++i) {
        cin >> x[i];
    }
    ll ans = -1e18;
    for (int i = 0; i < (1 << m); ++i) {
        a.assign(n, 0);
        for (int j = 0; j < m; ++j) {
            if (i & (1 << j)) {
                a[1] = x[j] - a[1];
            } else {
                a[0] = x[j] - a[0];
            }
        }
        ans = max(ans, a[0] + a[1]);
    }
    cout << ans;
}

struct segtree {
    vector <ll> t;
    ll size;
    void init(ll n) {
        size = 1;
        while (size < n)
            size *= 2;
        t.resize(size * 2 - 1);
    }

    ll merge(ll a, ll b) {
        return max(a, b);
    }

    void set(ll v, ll x, ll i, ll l, ll r) {
        if (r - l == 1) {
            t[v] = x;
            return;
        }
        ll m = (l + r) / 2;
        if (i < m)
            set(v * 2 + 1, x, i, l, m);
        else
            set(v * 2 + 2, x, i, m, r);
        t[v] = merge(t[v * 2 + 1], t[v * 2 + 2]);
    }
    void set(ll x, ll i) {
        set(0, x, i, 0, size);
    }

    ll get(ll v, ll tl, ll tr, ll ql, ll qr) {
        if (tr <= ql || tl >= qr) {
            return 0;
        }
        if (tl >= ql && tr <= qr) {
            return t[v];
        }
        ll tm = (tl + tr) / 2;
        return merge(get(v * 2 + 1, tl, tm, ql, qr), get(v * 2 + 2, tm, tr, ql, qr));
    }
    ll get(ll l, ll r) {
        return get(0, 0, size, l, r);
    }
};

vector <vector <ll>> gr;
vector <ll> x, s, tin, tout, d;
vector <bool> used;
ll timer = 0;

void dfs(ll v) {
    used[v] = true;
    tin[v] = timer++;
    for (auto u : gr[v]) {
        if (!used[u]) {
            d[u] = d[v] + 1;
            dfs(u);
        }
    }
    tout[v] = timer++;
}

bool anc(ll v, ll u) {
    return tin[v] <= tin[u] && tout[v] >= tout[u];
}

void solve2() {
    ll n, q;
    cin >> n >> q;
    vector <ll> p(n, -1);
    gr.resize(n), used.resize(n), x.resize(n, 1e18), s.resize(n);
    for (int i = 1; i < n; ++i) {
        ll v;
        cin >> v;
        v--;
        p[i] = v;
        gr[v].emplace_back(i);
        gr[i].emplace_back(v);
    }
    for (int i = 0; i < n; ++i) {
        cin >> s[i];
    }
    tin.resize(n), tout.resize(n), d.resize(n);
    dfs(0);
    for (int i = 0; i < q; ++i) {
        ll v;
        cin >> v;
        v--;
        if (v == 0) {
            cout << 0 << '\n';
            continue;
        }
        cout << d[v] << '\n';
        ll ans = 1e9;

    }
}

/*7 6
1 2 3 1 5 6
4 3 5 7 2 6 1
2 3 4 5 6 7*/

void solve3() {
    ll n, k;
    cin >> n >> k;
    vector <ll> a(n);
    ll mx1 = 0, mx2 = 0;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        if (a[i] >= mx1) {
            mx2 = mx1;
            mx1 = a[i];
        } else if (a[i] > mx2) {
            mx2 = a[i];
        }
    }
    cout << mx1 + mx2 + n;
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    ll tt = 1;
    //cin >> tt;
    while (tt--) {
        solve3();
        cout << endl;
    }
}
