#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100100;
int n, m, k, f[MAXN], memo[2 * MAXN][(1 << 8)];
vector<pair<int, int>> e;
int dp(int idx, int mask) {
  if (idx == e.size()) return 0;
  if (memo[idx][mask] != -1) return memo[idx][mask];
  auto& [pos, id] = e[idx];
  int prevPos = (idx ? e[idx - 1].first : 0);
  int aux = (__builtin_popcount(mask) % 2) * (pos - prevPos);
  if (id < 0) return memo[idx][mask] = dp(idx + 1, mask & ~(1 << f[-id])) + aux;
  return memo[idx][mask] =
             max(dp(idx + 1, mask), dp(idx + 1, mask | (1 << f[id]))) + aux;
}
int main() {
  memset(memo, -1, sizeof memo);
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 1, l, r; i <= n; ++i)
    scanf("%d %d", &l, &r), e.emplace_back(l, i), e.emplace_back(r + 1, -i);
  sort(e.begin(), e.end());
  set<int> s;
  for (int i = 0; i < k; ++i) s.insert(i);
  for (auto& [pos, id] : e) {
    if (id < 0)
      s.insert(f[-id]);
    else
      f[id] = *s.begin(), s.erase(s.begin());
  }
  printf("%d\n", dp(0, 0));
}
