#include <bits/stdc++.h>
using namespace std;
const int N = 40043;
const long long int mod = 1e9 + 7;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int lcm(int a, int b) { return (a * b) / gcd(a, b); }
long long int pow(long long int a, long long int b, long long int mo) {
  if (a == 0) return 1;
  long long int u = pow(a, b / 2, mo);
  u = (u % mod * u % mod) % mo;
  if (b % 2 == 1) u = (u % mod * a % mod) % mod;
  return u;
}
long long int power(long long int a, long long int b) {
  long long int ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
long long int xx, yy, dd;
void equation(long long int a, long long int b) {
  if (b == 0) {
    xx = 1;
    yy = 0;
    dd = a;
  } else {
    equation(b, a % b);
    long long int temp = xx;
    xx = yy;
    yy = temp - (a / b) * yy;
  }
}
long long int inverse(long long int a, long long int m) {
  equation(a, m);
  return (xx % m + m) % m;
}
bool compare(const char &i, char &j) { return i > j; }
void solve() {
  long long int n, m, k, l = 0;
  cin >> n >> m >> k;
  long long int a[n], b[n];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i] - l;
    l = a[i];
  }
  sort(b + 1, b + n);
  long long int sum = 0;
  for (long long int i = 1; i <= n - k; i++) sum += b[i];
  cout << sum + k;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  t = 1;
  while (t--) solve(), cout << endl;
}
