#include <bits/stdc++.h>
using namespace std;
const long long inf = 0x3f3f3f3f3f3f3f3f;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long m;
  cin >> m;
  long long lo = 0, hi = 1e18, md, n = -1;
  while (lo <= hi) {
    md = lo + (hi - lo) / 2;
    long long cnt = 0;
    long long k = 2;
    while (md >= (k * k * k)) {
      cnt += md / (k * k * k);
      ++k;
    }
    if (cnt == m) {
      n = md;
      hi = md - 1;
    } else if (cnt < m) {
      lo = md + 1;
    } else {
      hi = md - 1;
    }
  }
  cout << n;
  return 0;
}
