#include <bits/stdc++.h>
using namespace std;
int a[1000005], v[1000005];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  int j = 0;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    if (i != 0) {
      a[j] = v[i] - v[i - 1] - 1;
      j++;
    }
  }
  sort(a, a + j);
  int w = 0;
  for (int i = 0; i < n - k; i++) {
    w += a[i];
  }
  w += n;
  cout << w << endl;
  return 0;
}
