#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int64_t lol;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cerr.tie(nullptr);
  int64_t testc = 1;
  while (testc--) {
    long long n, m, k;
    cin >> n >> m >> k;
    vector<long long> v(n);
    vector<long long> seg;
    for (auto &i : v) {
      cin >> i;
    }
    for (long long i = 1; i < n; i++) {
      seg.push_back(v[i] - v[i - 1]);
    }
    sort(seg.begin(), seg.end(), greater<long long>());
    long long out = 0, z = (n - k);
    while (z--) {
      out += seg.back();
      seg.pop_back();
    }
    out += k;
    cout << out;
  }
  return EXIT_SUCCESS;
}
