#include <bits/stdc++.h>
using namespace std;
int fx[] = {0, 1, -1, 0, 0, 1, 1, -1, -1};
int fy[] = {0, 0, 0, 1, -1, 1, -1, 1, -1};
int Set(int n, int pos) { return n = n | (1 << pos); }
int reset(int n, int pos) { return n = n & ~(1 << pos); }
bool check(int n, int pos) { return (bool)(n & (1 << pos)); }
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
};
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); };
string s;
int ara[105];
int main() {
  long long n;
  scanf("%I64d", &n);
  ++n;
  if (n <= 1)
    cout << "0" << endl;
  else if (n & 1)
    printf("%lld\n", n);
  else
    printf("%lld\n", n / 2);
}
