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