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