#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n, m, k;
  cin >> n >> m >> k;
  vector<ll> b(n);
  for (ll i = 0; i < (ll)n; i++) cin >> b[i];
  vector<ll> c;
  for (ll i = 0; i < (ll)n - 1; i++) {
    c.push_back(b[i + 1] - b[i] - 1);
  }
  sort(c.begin(), c.end());
  ll ans = n;
  for (ll i = 0; i < (ll)n - k; i++) ans += c[i];
  cout << ans << endl;
  return 0;
}
