#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <sstream>
#include <cmath>
#include <chrono>
#include <random>
#define endl '\n'
#define ALL(v) v.begin(), v.end()
#define current_time chrono::steady_clock().now().time_since_epoch().count()

using namespace std;

template <typename T1, typename T2>
bool rmin(T1& x, const T2& y)
{
	if (y < x)
	{
		x = y;
		return true;
	}
	return false;
}
template <typename T1, typename T2>
bool rmax(T1& x, const T2& y)
{
	if (x < y)
	{
		x = y;
		return true;
	}
	return false;
}

constexpr uint32_t MOD = 998'244'353, MOD_phi = MOD - 1;

struct Mod_int
{
	uint32_t val;

	Mod_int& operator+=(const Mod_int& a)
	{
		if ((val += a.val) >= MOD)
		{
			val -= MOD;
		}
		return *this;
	}
	Mod_int& operator-=(const Mod_int& a)
	{
		if ((val -= a.val) & 0x80'00'00'00)
		{
			val += MOD;
		}
		return *this;
	}
	Mod_int& operator*=(const Mod_int& a)
	{
		val = int64_t(val) * a.val % MOD;
		return *this;
	}

	friend Mod_int operator+(const Mod_int& a, const Mod_int& b)
	{
		return Mod_int(a) += b;
	}
	friend Mod_int operator-(const Mod_int& a, const Mod_int& b)
	{
		return Mod_int(a) -= b;
	}
	friend Mod_int operator*(const Mod_int& a, const Mod_int& b)
	{
		return Mod_int(a) *= b;
	}

	Mod_int pow(uint64_t pow_val) const
	{
		Mod_int ans{ 1 }, mlt{ val };
		while (pow_val)
		{
			if (pow_val & 1)
			{
				ans *= mlt;
			}
			mlt *= mlt;
			pow_val >>= 1;
		}
		return ans;
	}

	Mod_int& operator/=(const Mod_int& a)
	{
		return *this *= a.pow(MOD_phi - 1);
	}

	friend Mod_int operator/(const Mod_int& a, const Mod_int& b)
	{
		return Mod_int(a) /= b;
	}
};

void solve();

signed main()
{
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
#endif // _DEBUG
	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int t = 1;
	//cin >> t;
	for (int i = 0; i < t; i++)
	{
		solve();
		cout << endl;
	}

	return 0;
}

void solve()
{
	int n, k;
	cin >> n >> k;
	multiset<int> st;
	for (int i = 0; i < n - 1; i++)
	{
		int x;
		cin >> x;
		st.insert(x);
	}
	int64_t ans;
	cin >> ans;
	ans += n;
	for (int i = 0; i < k - 1; i++)
	{
		ans += *prev(st.end());
		st.erase(prev(st.end()));
	}
	cout << ans;

	return;
}