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