#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int p, n;
  cin >> p;
  n = p + 1;
  if (p == 0 || p == 1)
    cout << p;
  else if (n % 2 != 0) {
    cout << n;
  } else
    cout << n / 2;
}
