#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 10;
const long long M = 13;
const long long inf = 1e9 + 7;
const long long Mod = 1e9 + 7;
const double eps = 1e-6;
long long n;
int main() {
  scanf("%lld", &n);
  n++;
  long long ans;
  if (n & 1) {
    if (n > 1)
      ans = n;
    else
      ans = 0;
  } else
    ans = n / 2;
  printf("%lld", ans);
  return 0;
}
