#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long i, j, k, n, m;
  cin >> n;
  if (n == 0) {
    cout << "0" << endl;
    return 0;
  }
  if ((n + 1) % 2 != 0) {
    m = (n + 1) * 2;
    j = m / 2;
    cout << j << endl;
  } else {
    j = (n + 1) / 2;
    cout << j << endl;
  }
}
