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