#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<long long int, char> p1, pair<long long int, char> p2) {
  return p1.first > p2.first;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  if (n == 0) {
    cout << "0"
         << "\n";
    return 0;
  }
  if ((n + 1) % 2 == 0) {
    cout << (n + 1) / 2 << "\n";
  } else
    cout << (n + 1) << "\n";
}
