#include <bits/stdc++.h>
int main() {
  unsigned long long int nf, cuts;
  scanf("%llu", &nf);
  if (nf == 0) {
    printf("0", cuts);
  } else if (nf > 0 && nf <= 1000000000000000000) {
    if ((nf + 1) % 2 == 0) {
      cuts = (nf + 1) / 2;
      printf("%llu", cuts);
    } else {
      cuts = nf + 1;
      printf("%llu", cuts);
    }
  } else {
    printf("Number of friends need to be between 1 to 1000000000000000000");
  }
  return 0;
}
