#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 1000000;
const int mod = 998244353;
bool cmp(int x, int y) { return x > y; }
int main() {
  long long n, ans = 0;
  cin >> n;
  if (n == 0) {
    cout << 0;
    return 0;
  }
  n += 1;
  if (n % 2 == 0) {
    ans = n / 2;
  } else {
    ans = n;
  }
  cout << ans;
  return 0;
}
