#include <bits/stdc++.h>
using namespace std;
long long work(long long a, long long b, long long c) {
  long long ans = 0;
  long long p = min(a, b);
  c += p;
  ans += p;
  a -= p;
  b -= p;
  if (b == 0) b = a;
  if (b & 1) return -1;
  if (c == 0) return -1;
  ans += b;
  return ans;
}
int main() {
  long long a[3];
  cin >> a[0] >> a[1] >> a[2];
  long long ans = -1;
  for (int i = 0; i < 3; ++i)
    for (int j = 0; j < 3; ++j)
      if (i != j) {
        long long now = work(a[i], a[j], a[3 - i - j]);
        if (now == -1) continue;
        if (ans == -1 || now < ans) ans = now;
      }
  cout << ans << endl;
  return 0;
}
