#include <bits/stdc++.h>
using namespace std;
void init() {}
long long go(long long n) {
  long long sum = 0;
  for (long long i = 2; i <= 1e6; i++) {
    sum += n / (i * i * i);
  }
  return sum;
}
int main() {
  long long m;
  cin >> m;
  long long l = 0, h = 1e17;
  long long ans = -1;
  while (l <= h) {
    long long mid = (l + h) / 2;
    long long x = go(mid);
    if (x == m) {
      ans = mid;
      h = mid - 1;
    } else if (x > m)
      h = mid - 1;
    else
      l = mid + 1;
  }
  if (ans != -1)
    cout << ans;
  else
    cout << "-1";
  return 0;
}
