#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout << setprecision(6) << fixed;
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> gaps;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i != 0) gaps.push_back(a[i] - a[i - 1]);
  }
  sort(gaps.begin(), gaps.end());
  int sum = 0;
  for (int i = 0; i < (k - 1); ++i) {
    sum += gaps[gaps.size() - 1 - i] - 1;
  }
  sum = a[n - 1] - a[0] + 1 - sum;
  cout << sum << endl;
  return 0;
}
