#include <bits/stdc++.h>
long long a, b, c, Ans, Now;
void GetAns(long long a, long long b, long long c) {
  if ((a + b) & 1) return;
  if (a < b) a ^= b ^= a ^= b;
  a -= b;
  Now = 1ll * a + 1ll * b;
  if (Ans == -1 || Now < Ans) Ans = Now;
}
int main() {
  scanf("%I64d%I64d%I64d", &a, &b, &c);
  Ans = -1;
  GetAns(a, b, c);
  GetAns(c, b, a);
  GetAns(c, a, b);
  printf("%I64d\n", Ans);
  return 0;
}
