#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
const long long INF = 2e18;
long long m;
long long pre(long long n) {
  long long cnt = 0;
  for (long long k = 2; k <= N; k++) {
    if (n < k * k * k) break;
    cnt += n / (k * k * k);
  }
  return cnt >= m;
}
long long goal(long long n) {
  long long cnt = 0;
  for (long long k = 2; k <= N; k++) {
    if (n < k * k * k) break;
    cnt += n / (k * k * k);
  }
  return cnt;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> m;
  long long lo = 0, hi = 2e18;
  while (lo < hi - 1) {
    long long mid = lo + hi + 1 >> 1;
    if (pre(mid) == true) {
      hi = mid;
    } else {
      lo = mid + 1;
    }
  }
  long long ans = -1;
  for (long long i = -10; i <= 10; i++) {
    if (lo + i >= 0 and goal(lo + i) == m) {
      ans = lo + i;
      break;
    }
  }
  cout << ans << endl;
  return 0;
}
