#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> v1, v2;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    v1.push_back(x);
  }
  sort(v1.begin(), v1.end());
  int s = v1.size();
  int len = v1[s - 1] - v1[0] + 1;
  for (int i = 0; i < n - 1; i++) {
    int y = v1[i + 1] - v1[i] - 1;
    v2.push_back(y);
  }
  sort(v2.begin(), v2.end());
  k -= 1;
  int s2 = v2.size() - 1;
  while (k--) {
    len = len - (v2[s2--]);
  }
  cout << len;
  return 0;
}
