#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int a[maxn];
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  long long sum = a[n] - a[1] + 1;
  vector<int> v;
  v.clear();
  for (int i = 2; i <= n; i++) v.push_back(a[i] - a[i - 1] - 1);
  sort(v.begin(), v.end(), greater<int>());
  int sz = v.size();
  int Min = min(sz, k - 1);
  for (int i = 0; i < Min; i++) sum -= v[i];
  printf("%lld\n", sum);
}
