#include <bits/stdc++.h>
using namespace std;
long long solve(long long &n) { return (n < 2) ? 0 : (n % 2 == 0) ? n / 2 : n; }
int main() {
  long long n;
  while (cin >> n) {
    cout << solve(++n) << endl;
  }
}
