#include <bits/stdc++.h>
using namespace std;
long long n, m, k, a[100005], b[100005], num;
int main() {
  cin >> n >> m >> k;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long i = 1; i < n; i++) {
    b[i] = a[i] - a[i - 1] - 1;
  }
  sort(b, b + n);
  for (long long i = 1; i < n - k + 1; i++) {
    num += b[i];
  }
  cout << num + n << endl;
  return 0;
}
