#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> v;
  int n, m, y, x, k, s;
  cin >> n >> m >> k;
  s = n;
  cin >> x;
  for (int i = 1; i < n; i++) {
    cin >> y;
    v.push_back(y - x - 1);
    x = y;
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < n - k; i++) s += v[i];
  cout << s;
}
