#include <bits/stdc++.h>
using namespace std;
const int MAX = (int)1e5 + 5;
vector<int> v;
vector<int> q;
int n, len, k;
int main() {
  scanf("%d%d%d", &n, &len, &k);
  for (int i = (0); i < (n); ++i) {
    int a;
    scanf("%d", &a);
    v.push_back(a);
  }
  for (int i = (0); i < (n - 1); ++i) q.push_back(v[i + 1] - v[i] - 1);
  sort(q.begin(), q.end());
  long long s = 0;
  for (int i = (0); i < (n - k); ++i) s += q[i];
  printf("%lld\n", s + n);
  return 0;
}
