#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  n++;
  int64_t base = 2, ans = 1;
  while (n > 0) {
    if (n & 1) ans *= base;
    base *= base;
    n /= 2;
  }
  cout << ans - 2;
  return 0;
}
