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