#include <bits/stdc++.h>
int main(void) {
  long long n;
  scanf("%I64d", &n);
  if (n == 0)
    printf("0\n");
  else if (n % 2)
    printf("%I64d\n", (n + 1) / 2);
  else
    printf("%I64d\n", n + 1);
  return 0;
}
