#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
long long R = 7 + 1e9, NUMTESTCASE;
const long long NN = 10 + 1e6;
const double pi = acos(-1.0);
int di[8] = {1, 0, -1, 0, 1, -1, 1, -1}, dj[8] = {0, 1, 0, -1, 1, -1, -1, 1};
int n, m, k, Arr[NN], Mark[NN];
int Root(int u) {
  while (u != Mark[u]) {
    Mark[u] = Mark[Mark[u]];
    u = Mark[u];
  }
  return u;
}
void Merge(int u, int v) {
  u = Root(u);
  v = Root(v);
  if (u < v) swap(u, v);
  Mark[u] = v;
}
int main() {
  cin >> n >> m >> k;
  for (int i = (1); i <= (n); ++i) scanf("%d", Arr + i);
  vector<pair<int, int>> Rec;
  for (int i = (2); i <= (n); ++i) Rec.push_back({Arr[i] - Arr[i - 1] + 1, i});
  sort(Rec.begin(), Rec.end());
  while (--k && Rec.size()) Rec.pop_back();
  int Ans = 0;
  for (int i = (1); i <= (n); ++i) Mark[i] = i;
  if (Rec.size())
    for (pair<int, int> u : Rec) Merge(u.second, u.second - 1);
  map<int, set<int>> Flag;
  for (int i = (1); i <= (n); ++i) Flag[Root(i)].insert(Arr[i]);
  for (auto it : Flag) Ans += (*it.second.rbegin()) - (*it.second.begin()) + 1;
  cout << Ans;
  return 0;
}
