#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 123;
bool used[N];
long long d[N];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m, k;
  cin >> n >> m >> k;
  long long prev = 0;
  cin >> prev;
  d[0] = prev;
  vector<pair<long long, long long> > v;
  for (long long i = 1; i < n; ++i) {
    long long a;
    cin >> a;
    d[i] = a;
    v.push_back({a - prev, i - 1});
    prev = a;
  }
  sort(v.begin(), v.end());
  long long ans = 0;
  for (long long i = 0; i < n - k; ++i) {
    used[v[i].second + 1] = 1;
  }
  ans = n;
  for (long long i = 1; i < n; ++i) {
    if (used[i]) {
      ans += d[i] - d[i - 1] - 1;
    }
  }
  cout << ans;
  return 0;
}
