#include <bits/stdc++.h>
using namespace std;
long long check(vector<long long> &a, long long t) {
  long long ans = 1, lst = a[0];
  for (long long i = 1; i < a.size(); i++)
    if (a[i] - lst > t) {
      lst = a[i];
      ans++;
    }
  return ans;
}
long long answ(vector<long long> &a, long long t) {
  long long ans = 0;
  long long lst = a[0];
  for (long long i = 1; i < a.size(); i++)
    if (a[i] - lst > t) {
      ans += a[i - 1] - lst + 1;
      lst = a[i];
    }
  return ans;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  long long n, k, l, r, m1, m;
  cin >> n >> m >> k;
  vector<long long> a(n);
  for (auto &i : a) cin >> i;
  vector<long long> b(n - 1);
  for (long long i = 0; i < n - 1; i++) b[i] = a[i + 1] - a[i] - 1;
  sort(b.begin(), b.end());
  long long ans = n;
  for (long long i = 0; i < n - k; i++) ans += b[i];
  cout << ans;
  return 0;
}
