#include <bits/stdc++.h>
using namespace std;
double PI = 3.141592653589793;
const double EPS = 1e-9;
const int N = 1e6 + 5;
const long long mod = 1e9 + 7;
const int oo = 1e9;
int dx[] = {0, 0, 1, -1, 1, -1, 1, -1};
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
long long m;
int main() {
  scanf("%lld", &m);
  long long l = 1, r = 1e18, ans = -1;
  while (l <= r) {
    long long mid = (l + r) / 2;
    long long ways = 0;
    for (long long k = 2; k <= 1e6; k++) {
      long long tmp = mid;
      tmp = tmp / (k * k * k);
      if (tmp == 0) break;
      ways += tmp;
    }
    if (ways >= m) {
      if (ways == m) ans = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  printf("%lld", ans);
}
