#include <bits/stdc++.h>
using namespace std;
const long long mx = 10000000000000000;
long long n;
long long judge(long long num) {
  long long ans = 0, flag = 1;
  ;
  for (long long k = 2; k <= 1000000 && flag; k++) {
    if (k * k * k > num) flag = 0;
    ans += num / (k * k * k);
  }
  return ans;
}
long long search(long long mi, long long ma) {
  long long l = mi, r = ma, ans = -1;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    long long cu = judge(mid);
    if (cu >= n) {
      if (cu == n) ans = mid;
      r = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  return ans;
}
int main() {
  scanf("%lld", &n);
  printf("%lld\n", search(1, mx));
  return 0;
}
