#include <bits/stdc++.h>
const int N = 200010;
int a[N], b[N];
int main() {
  int n, m, k, sum = 0;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  sum += a[1] - 1;
  sum += m - a[n];
  for (int i = 2; i <= n; ++i) b[i - 1] = a[i] - a[i - 1] - 1;
  std::sort(b + 1, b + n);
  for (int i = n - 1; i >= n - k + 1; --i) sum += b[i];
  printf("%d", m - sum);
  return 0;
}
