#include <bits/stdc++.h>
using namespace std;
vector<int> a;
int main() {
  ios_base::sync_with_stdio(0);
  int n, m, k;
  cin >> n >> m >> k;
  int x, px = 1, ans = 1;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    if (i > 0 && x > px + 1) a.push_back(x - px - 1);
    if (i > 0) ans += x - px;
    px = x;
  }
  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  for (int i = 0; i < a.size() && i < k - 1; ++i) ans -= a[i];
  cout << ans << endl;
}
