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