#include <bits/stdc++.h>
using namespace std;
const long long int INF = 1e15;
const long long int MOD = 1e9 + 7;
template <typename T>
using vector2 = vector<vector<T>>;
template <typename T>
vector2<T> initVec2(size_t n0, size_t n1, T e = T()) {
  return vector2<T>(n0, vector<T>(n1, e));
}
template <typename T>
using vector3 = vector<vector<vector<T>>>;
template <typename T>
vector3<T> initVec3(size_t n0, size_t n1, size_t n2, T e = T()) {
  return vector3<T>(n0, vector2<T>(n1, vector<T>(n2, e)));
}
bool compare(pair<long long int, long long int> a,
             pair<long long int, long long int> b) {
  return a.second - a.first > b.second - b.first;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long int n, m, k;
  cin >> n >> m >> k;
  vector<long long int> b(n);
  for (long long int i = 0; i < (n); ++i) cin >> b[i];
  vector<pair<long long int, long long int>> a;
  for (long long int i = 0; i < (n - 1); ++i) {
    a.emplace_back(b[i], b[i + 1]);
  }
  sort((a).begin(), (a).end(), compare);
  long long int ans = 0;
  long long int l = min(k - 1, n - 1);
  for (long long int i = 0; i < (l); ++i) {
    ans += a[i].second - a[i].first - 1;
  }
  cout << b[n - 1] - b[0] + 1 - ans << endl;
  return 0;
}
