#include <bits/stdc++.h>
using namespace std;
long long po(long long x, long long n) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return po((x * x) % 1000000007, n / 2);
  else
    return (x * po((x * x) % 1000000007, (n - 1) / 2)) % 1000000007;
}
void solve() {
  long long n;
  cin >> n;
  if (n == 0) {
    cout << 0;
    return;
  }
  n++;
  if (n % 2 == 0) {
    cout << n / 2;
  } else
    cout << n;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int t = 1;
loop:
  while (t--) {
    solve();
  }
}
