#include <bits/stdc++.h>
using namespace std;
long long n, i, j, k, a[1001];
string s;
vector<long long> v;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  while (cin >> n) {
    if (n % 2 || !n)
      cout << (n + 1) / 2 << endl;
    else
      cout << n + 1 << endl;
  }
  return 0;
}
