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