#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000000 + 7;
int bs(int *st, int *en, int val, char c) {
  int k;
  if (c == 'l') k = lower_bound(st, en, val) - st;
  if (c == 'u') k = upper_bound(st, en, val) - st;
  return k;
}
int prime[780500];
int sieve() {
  int a, b, c;
  c = 0;
  prime[c] = 2;
  bool *m = (bool *)calloc(1000006, sizeof(bool));
  for (a = 3; a <= 1000000; a = a + 2) {
    if (!m[a]) {
      prime[++c] = a;
      for (b = 2 * a; b <= 1000000; b = b + a) m[b] = true;
    }
  }
  free(m);
  return c;
}
vector<long long> primes;
const int N = 15000000;
int lp[N + 1];
void genPrimes() {
  primes.reserve(N / 10);
  for (int i = 2; i <= N; ++i) {
    if (lp[i] == 0) {
      lp[i] = i;
      primes.push_back(i);
    }
    for (int j = 0; j < primes.size(); j++) {
      int p = primes[j];
      int q = i * p;
      if (q > N || p > lp[i]) {
        break;
      }
      lp[q] = p;
    }
  }
}
long long bigmod(long long a, long long n) {
  n %= mod - 1;
  long long res = 1;
  while (n) {
    if (n & 1ll) {
      res = res * a;
      if (res >= mod) {
        res %= mod;
      }
    }
    a = a * a;
    if (a >= mod) {
      a %= mod;
    }
    n >>= 1;
  }
  return res;
}
int main() {
  long long a, b, c, d, e, x, y, z;
  long long A, B, C;
  cin >> A >> B >> C;
  x = 0;
  if (!A) x++;
  if (!B) x++;
  if (!C) x++;
  if (x >= 2) {
    printf("0\n");
    return 0;
  }
  x = 0;
  if (A == B) x++;
  if (B == C) x++;
  if (C == A) x++;
  if (x >= 1) {
    if (A == B) x = A;
    if (B == C) x = B;
    if (C == A) x = C;
    cout << x << endl;
    return 0;
  }
  z = 0;
  vector<long long> v;
  v.clear();
  v.push_back(A);
  v.push_back(B);
  v.push_back(C);
  sort(v.begin(), v.end());
  C = v[0];
  B = v[1];
  A = v[2];
  if (C) z = z + C;
  y = B - C;
  A = A + C;
  x = A / (B - C);
  z = z + x * y;
  z = z + (A % (B - C));
  C = v[0];
  B = v[1];
  A = v[2];
  if ((B - C) % 2 == 0) {
    z = min(z, B);
  }
  if ((A - B) % 2 == 0) {
    x = (A - B) / 2;
    z = min(z, A);
  }
  if ((A - C) % 2 == 0) {
    x = (A - C) / 2;
    z = min(z, A);
  }
  cout << z << endl;
  return 0;
}
