#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m, k, times = 0;
  cin >> n >> m >> k;
  int arr[n - 1], b[n];
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    times++;
    if (i == 0) {
      continue;
    } else {
      arr[i - 1] = (b[i] - b[i - 1]) - 1;
    }
  }
  sort(arr, arr + n - 1);
  int t = n - k;
  for (int i = 0; i < t; i++) {
    times = times + arr[i];
  }
  cout << times;
}
