#include <bits/stdc++.h>
using namespace std;
const int N = 1;
const int P = 998244353;
long long n;
void init() {
  scanf("%lld", &n);
  n++;
  if (n == 1) {
    printf("0\n");
    return;
  }
  if (n % 2 == 0) n /= 2;
  printf("%lld\n", n);
}
int main(int argc, char** argv) {
  init();
  return 0;
}
