#include <bits/stdc++.h>
using namespace std;
double EPS = 1e-12;
const int INF = 0x3f3f3f3f;
const int MAXN = 2e5 + 5;
int32_t main() {
  int n, m, k, res = 0;
  cin >> n >> m >> k;
  int a[n + 1];
  for (int i = 1; i <= n; i++) cin >> a[i];
  if (n == 1) {
    return puts("1"), 0;
  } else {
    for (int i = 1; i < n; i++) a[i] = a[i + 1] - a[i] - 1;
    sort(a + 1, a + n);
    for (int i = 1; i <= n - k; i++) res += a[i];
  }
  cout << n + res;
}
