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