#include <bits/stdc++.h>
using namespace std;
const int N = 5010;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  n += 1;
  if (n == 1) return cout << 0 << endl, 0;
  if (n % 2 == 0)
    cout << n / 2 << endl;
  else
    cout << n << endl;
}
