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