#include <bits/stdc++.h>
const int N = 100005;
const long double pi = 3.141592653;
const long long MOD = 1000000007;
using namespace std;
int dx[9] = {1, -1, 0, 0, 1, 1, -1, -1, 0};
int dy[9] = {0, 0, 1, -1, 1, -1, 1, -1, 0};
bool cmp(pair<long long, long long> a1, pair<long long, long long> a2) {
  return a1.first < a2.first || (a1.first == a2.first && a1.second < a2.second);
}
bool cmpi(pair<long long, long long> a1, pair<long long, long long> a2) {
  return a1.second < a2.second;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m, k, i, j, ans = 0;
  cin >> n >> m >> k;
  vector<long long> a(n);
  vector<pair<long long, long long> > d, x;
  vector<bool> vis(n, false);
  for (i = 0; i < n; i++) cin >> a[i];
  if (n == 1)
    cout << 1;
  else {
    for (i = 1; i < n; i++) d.push_back({a[i] - a[i - 1], i - 1});
    sort(d.begin(), d.end(), cmp);
    for (i = 0; i < n - k; i++) x.push_back(d[i]);
    if (x.size() != 0) {
      sort(x.begin(), x.end(), cmpi);
      for (i = 0; i < x.size(); i++) {
        j = i;
        vis[x[i].second] = true;
        if (x[i].second + 1 < n) vis[x[i].second + 1] = true;
        ans = ans + x[i].first;
        while (j + 1 < x.size() && x[j + 1].second - x[j].second == 1) {
          ans = ans + x[j + 1].first;
          vis[x[j + 1].second] = true;
          if (x[j + 1].second + 1 < n) vis[x[j + 1].second + 1] = true;
          j++;
        }
        ans++;
        i = j;
      }
    }
    for (i = 0; i < n; i++) {
      if (vis[i] == false) ans++;
    }
    cout << ans;
  }
  return 0;
}
