#include <bits/stdc++.h>
using namespace std;
inline long long calc(long long a, long long b, long long c) {
  if (a < b) swap(a, b);
  a -= b;
  c += b;
  long long Cnt = b;
  b = 0;
  if (c == 0) return 1e18;
  if (a & 1) return 1e18;
  return Cnt + a;
}
int main() {
  long long a, b, c;
  cin >> a >> b >> c;
  long long res = min({calc(a, b, c), calc(a, c, b), calc(b, c, a)});
  if (res == 1e18)
    cout << -1;
  else
    cout << res;
  return 0;
}
