#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  while (cin >> n) {
    if (!n) {
      cout << 0 << endl;
      continue;
    }
    if (n & 1)
      cout << ((n + 1) >> 1) << endl;
    else
      cout << n + 1 << endl;
  }
}
