#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  scanf("%d %d %d", &n, &m, &k);
  vector<pair<int, int>> v(1);
  for (int i = 1; i <= n; i++) {
    int l, r;
    scanf("%d %d", &l, &r);
    v.emplace_back(l, i);
    v.emplace_back(r + 1, -i);
  }
  sort(v.begin() + 1, v.end());
  vector<int> st(k);
  int sz = (int)v.size() - 1;
  vector<vector<int>> dp(2, vector<int>(1 << k, -1e9));
  dp[0][0] = 0;
  for (int i = 1; i <= sz; i++) {
    int nxt = i & 1, pre = nxt ^ 1;
    assert(nxt != pre);
    int len = 0, id = v[i].second;
    if (i < sz) len = v[i + 1].first - v[i].first;
    if (id > 0) {
      int pos = -1;
      for (int j = 0; j < k && pos == -1; j++)
        if (!st[j]) pos = j, st[j] = id;
      for (int j = 0; j < (1 << k); j++) {
        if ((j >> pos) & 1)
          dp[nxt][j] = dp[pre][j ^ (1 << pos)] + len * __builtin_parity(j);
        else
          dp[nxt][j] = dp[pre][j] + len * __builtin_parity(j);
      }
    } else {
      int pos = -1;
      for (int j = 0; j < k && pos == -1; j++)
        if (st[j] == -id) pos = j, st[j] = 0;
      for (int j = 0; j < (1 << k); j++) {
        if ((j >> pos) & 1)
          dp[nxt][j] = -1e9;
        else
          dp[nxt][j] = max(dp[pre][j], dp[pre][j ^ (1 << pos)]) +
                       len * __builtin_parity(j);
      }
    }
  }
  printf("%d\n", dp[sz & 1][0]);
  return 0;
}
