#include <bits/stdc++.h>
using namespace std;
template <typename T>
void out(T x) {
  cout << x << endl;
  exit(0);
}
const int maxn = 4e5 + 5;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  if (n == 0) out(0);
  n++;
  if (n % 2 == 0) {
    cout << n / 2 << endl;
  } else {
    cout << n << endl;
  }
  return 0;
}
