#include <bits/stdc++.h>

using namespace std;

#define int long long

void solve()
{
	int n,k;
	cin>>n>>k;
	int a[n];
	for (int i=0;i<n;i++)
		cin>>a[i];
	int ans=0;
	for (int i=n-1;i>=n-k;i--)
		ans+=a[i];
	cout<<ans+n<<endl;
}

signed main()
{
	int t;
	// cin>>t;
	while (t--)
		solve();
	
	return 0;
}