#include <bits/stdc++.h>
using namespace std;
int n, m, k, v[100005];
pair<int, int> pr[100005];
bool stop[100005];
int ans, lst;
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &v[i]);
  sort(v + 1, v + n + 1);
  for (int i = 1; i < n; i++) {
    pr[i] = make_pair(v[i + 1] - v[i], i);
  }
  sort(pr + 1, pr + n);
  stop[1] = 1;
  k--;
  for (int i = n - 1; i >= n - k && i; i--) {
    stop[pr[i].second + 1] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (stop[i] == 1)
      ans++, lst = v[i];
    else
      ans = ans + (v[i] - lst), lst = v[i];
  }
  printf("%d\n", ans);
  return 0;
}
