#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
long long n, k, p1, p2, x, q, ans1, ans2, y, l, m, temp, ans, sum1;
long long minn = INT_MAX, temp1, temp2, maxx = INT_MIN, num1, num2, num, sum;
int main() {
  q = 1;
  while (q--) {
    cin >> n >> k >> x;
    int a[n];
    vector<int> b;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (i > 0) b.push_back(a[i] - a[i - 1] - 1);
    }
    sort(b.begin(), b.end());
    reverse(b.begin(), b.end());
    ans = a[n - 1] - a[0] + 1;
    for (int i = 0; i < x - 1; i++) {
      ans -= b[i];
    }
    cout << ans << "\n";
  }
}
