#include <bits/stdc++.h>
using namespace std;
vector<long long> fuck;
bool judge() {
  for (auto c : fuck) {
    if (c % 2 == 0 && c >= 0) return true;
  }
  return false;
}
int main() {
  long long a, b, c;
  cin >> a >> b >> c;
  fuck.push_back(a - c);
  fuck.push_back(b - c);
  fuck.push_back(b - a);
  fuck.push_back(c - a);
  fuck.push_back(a - b);
  fuck.push_back(c - b);
  if (!judge()) {
    cout << -1 << endl;
  } else {
    long long min1 = 9223372036854775807LL;
    if (fuck[0] % 2 == 0 && fuck[0] >= 0) {
      min1 = min(min1, a);
    }
    if (fuck[1] % 2 == 0 && fuck[1] >= 0) {
      min1 = min(min1, b);
    }
    if (fuck[2] % 2 == 0 && fuck[2] >= 0) {
      min1 = min(min1, b);
    }
    if (fuck[3] % 2 == 0 && fuck[3] >= 0) {
      min1 = min(min1, c);
    }
    if (fuck[4] % 2 == 0 && fuck[4] >= 0) {
      min1 = min(min1, a);
    }
    if (fuck[5] % 2 == 0 && fuck[5] >= 0) {
      min1 = min(min1, c);
    }
    cout << min1 << endl;
  }
}
