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