#include <bits/stdc++.h>
using namespace std;
bool comp(const int a, const int b) { return a < b; }
bool RelativelyPrime(int a, int b) {
  return (a < b)    ? RelativelyPrime(b, a)
         : !(a % b) ? (b == 1)
                    : RelativelyPrime(b, a % b);
}
int a[500005];
set<long long> s;
vector<long long> d[2000005];
void sieve() {
  for (int i = 2; i <= 2000005; i++) {
    if (!a[i]) {
      for (int j = i; j < 2000005; j += i) {
        a[j] = 1;
        d[j].push_back(i);
      }
    }
    s.insert(i);
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  if (n == 0) {
    cout << 0;
    return 0;
  }
  if ((n + 1) % 2)
    cout << n + 1;
  else
    cout << (n + 1) / 2;
  return 0;
}
