#include <bits/stdc++.h>
using namespace std;
int n, m, k, xa, xb;
long long ans, ji[100001];
void qsort(int p, int q) {
  if (p >= q) return;
  int t = ji[p], left = p, right = q;
  while (left < right) {
    while (left < right && ji[right] >= t) right--;
    ji[left] = ji[right];
    while (left < right && ji[left] <= t) left++;
    ji[right] = ji[left];
  }
  ji[left] = t;
  qsort(p, left - 1);
  qsort(left + 1, q);
}
int main() {
  cin >> n >> m >> k;
  cin >> xa;
  for (int i = 2; i <= n; i++) {
    cin >> xb;
    ji[i - 1] = xb - xa - 1;
    xa = xb;
  }
  qsort(1, n - 1);
  for (int i = 1; i <= n - k; i++) ans += ji[i];
  ans += n;
  cout << ans << endl;
  return 0;
}
