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