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