#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int a[100005];
int d[100005];
int sum;
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (i > 1) {
      d[i - 1] = a[i] - a[i - 1] - 1;
    }
  }
  sort(d + 1, d + n);
  sum = 0;
  for (int i = 1; i <= n - k; i++) {
    sum += d[i];
  }
  printf("%d\n", sum + n);
  return 0;
}
