#include <bits/stdc++.h>
using namespace std;
long long fast(long long a, long long b) {
  long long ans = 1;
  a = a % 1000000007;
  if (a == 0) return 0;
  while (b > 0) {
    if (b & 1) {
      ans = (ans * a) % 1000000007;
    }
    b >>= 1;
    a = (a * a) % 1000000007;
  }
  return ans;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, m, k;
  cin >> n >> m >> k;
  long long b[n + 2];
  for (long long i = 0; i < n; i++) {
    cin >> b[i];
  }
  vector<long long> v;
  for (long long i = 1; i < n; i++) {
    v.push_back(b[i] - b[i - 1] - 1);
  }
  sort(v.begin(), v.end(), greater<long long>());
  long long ans = b[n - 1] - b[0] + 1;
  long long sz = v.size();
  for (long long i = 0; i < min(sz, k - 1); i++) {
    ans -= v[i];
  }
  cout << ans << "\n";
  return 0;
}
