#include <bits/stdc++.h>
using namespace std;
long long int bin_src(long long int x) {
  long long int ans = 0;
  for (long long int i = 2; i * i * i <= x; i++) {
    ans += x / (i * i * i);
  }
  return ans;
}
int main() {
  long long int m, n = -1;
  cin >> m;
  long long int l = 1, h = 9e15;
  while (l < h) {
    long long int mid = (l + h) >> 1;
    if (bin_src(mid) < m)
      l = mid + 1;
    else
      h = mid;
  }
  if (bin_src(l) == m) n = l;
  cout << n << "\n";
  return 0;
}
