#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, M = 1 << 8;
struct line {
  int p, op, d;
  bool operator<(const line a) const {
    if (p == a.p) return op < a.op;
    return p < a.p;
  }
  line(int a = 0, int b = 0, int c = 0) { p = a, op = b, d = c; }
} l[2 * N];
int f[2 * N][M + 5], d[11], v[M + 5], cnt;
int n, m, k, now;
void init() {
  int maxn = (1 << k) - 1;
  sort(l + 1, l + 1 + cnt);
  for (int i = 1; i <= maxn; i++) v[i] = v[i - (i & -i)] + 1;
  for (int i = 0; i <= cnt; i++)
    for (int j = 0; j <= maxn; j++) f[i][j] = -(1e8);
  for (int i = 1; i <= k; i++) d[i] = -1;
  f[0][0] = 0;
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) {
    int L, R;
    scanf("%d%d", &L, &R);
    l[++cnt] = line(L, 1, i), l[++cnt] = line(R + 1, -1, i);
  }
  init();
  for (int i = 1; i <= cnt; i++) {
    int p = -1;
    if (l[i].op == 1) {
      for (int j = 1; j <= k; j++)
        if (d[j] == -1) {
          p = j, d[j] = l[i].d;
          break;
        }
      if (p == -1) continue;
      for (int j = 0; j <= now; j++) {
        if ((j & now) == j) {
          f[i][j] =
              max(f[i][j], f[i - 1][j] + (v[j] & 1) * (l[i].p - l[i - 1].p));
          f[i][j | (1 << (p - 1))] =
              max(f[i][j | (1 << (p - 1))],
                  f[i - 1][j] + (v[j] & 1) * (l[i].p - l[i - 1].p - 1) +
                      (v[j] + 1 & 1));
        }
      }
      now |= 1 << (p - 1);
    } else {
      for (int j = 1; j <= k; j++)
        if (d[j] == l[i].d) {
          p = j, d[j] = -1;
          break;
        }
      if (p == -1) continue;
      now ^= 1 << (p - 1);
      for (int j = 0; j <= now; j++) {
        if ((j & now) == j) {
          f[i][j] =
              max(f[i][j], f[i - 1][j] + (v[j] & 1) * (l[i].p - l[i - 1].p));
          f[i][j] =
              max(f[i][j], f[i - 1][j | (1 << (p - 1))] +
                               (v[j] + 1 & 1) * (l[i].p - l[i - 1].p - 1) +
                               (v[j] & 1));
        }
      }
    }
  }
  printf("%d", f[cnt][0]);
  return 0;
}
