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