#include <bits/stdc++.h>
using namespace std;
int main() {
  int left, right, duida, k;
  cin >> left >> right >> duida;
  if (duida == 0) {
    if (left == 0 || right == 0) {
      cout << "0" << endl;
      return 0;
    }
  }
  while (1) {
    if (duida == 0) {
      break;
    }
    if (left == right) {
      left += (duida / 2);
      right += (duida / 2);
      duida -= ((duida / 2) * 2);
      break;
    }
    if (left > right) {
      k = left - right;
      if (k >= duida) {
        right += duida;
        duida = 0;
      } else {
        right += k;
        duida -= k;
      }
    }
    if (right > left) {
      k = right - left;
      if (k >= duida) {
        left += duida;
        duida = 0;
      } else {
        left += k;
        duida -= k;
      }
    }
  }
  if (left > right && left != 1) left -= (left - right);
  if (right > left && right != 1) right -= (right - left);
  if (left == right)
    cout << left + right << endl;
  else
    cout << "0" << endl;
}
