#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int diff[n - 1];
  for (int i = 0; i < n - 1; i++) {
    diff[i] = a[i + 1] - a[i];
  }
  sort(diff, diff + n - 1, greater<int>());
  int sum = 0;
  for (int i = 0; i < k - 1; i++) {
    sum += diff[i];
  }
  cout << a[n - 1] - a[0] - sum + k;
}
