#include <bits/stdc++.h>
int main() {
  unsigned long long int n, s;
  while (~scanf("%llu", &n)) {
    if ((n + 1) % 2 == 0) s = (n + 1) / 2;
    if ((n + 1) % 2 == 1) s = n + 1;
    if (n == 0) s = 0;
    printf("%llu\n", s);
  }
}
