#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
template <class T1, class T2>
struct cmpf {
  bool rev;
  inline bool operator()(const pair<T1, T2>& a, const pair<T1, T2>& b) const {
    return (a.first < b.first) ^ rev;
  }
  cmpf(bool b = false) { rev = b; }
};
template <class T1, class T2>
struct cmps {
  bool rev;
  inline bool operator()(const pair<T1, T2>& a, const pair<T1, T2>& b) const {
    return (a.second < b.second) ^ rev;
  }
  cmps(bool b = false) { rev = b; }
};
long long binpow(long long x, long long p, const long long& mod) {
  assert(mod > 0);
  long long ret = 1;
  for (; p > 0; p >>= 1, x = x * x % mod)
    if (p & 1) ret = ret * x % mod;
  return ret;
}
template <class T>
bool chmn(T& a, const T& b) {
  return ((a > b) ? ((a = b) || true) : false);
}
template <class T>
bool chmx(T& a, const T& b) {
  return ((a < b) ? ((a = b) || true) : false);
}
void setIO(const string& filename = "") {
  cin.tie(0)->sync_with_stdio(0);
  if (filename.size() > 0) {
    freopen((filename + ".in").c_str(), "r", stdin);
    freopen((filename + ".out").c_str(), "w", stdout);
  }
}
int chr[8] = {-1, 0, 1, 0, -1, -1, 1, 1};
int chc[8] = {0, 1, 0, -1, -1, 1, -1, 1};
const long long MOD = 1e9 + 7;
const int INIT = 1001001001;
const int MN = 1001001;
const long long INF = 2e18;
long long N, M, K;
long long A[MN];
long long calc(long long a, long long b, long long c) {
  long long ret = 0;
  while (b > 0 || c > 0) {
    (a, b, c, ret);
    if (b > 0 && c > 0) {
      long long x = min(b, c);
      assert(x > 0);
      a += x;
      b -= x;
      c -= x;
      ret += x;
    } else {
      if (b < c) swap(b, c);
      assert(b > 0);
      assert(c == 0);
      if (a == 0 && c == 0) return ret;
      assert(a > 0);
      if (b == 1) {
        return ret + a;
      }
      long long x = b - (b & 1);
      assert(x > 0);
      b -= x;
      ret += x;
    }
  }
  return ret;
}
void solve(int testcase) {
  cin >> A[0] >> A[1] >> A[2];
  long long ans = INF;
  for (int i = 0; i < 3; ++i) {
    chmn(ans, calc(A[i], A[(i + 1) % 3], A[(i + 2) % 3]));
  }
  cout << ans << endl;
}
int main() {
  setIO();
  long long T = 1;
  for (int t = 1; t <= T; t++) solve(t);
  return 0;
}
