#include <bits/stdc++.h>
using namespace std;
long long m, l, r, mid;
long long F(long long n) {
  long long res = 0;
  for (long long k = 2; k * k * k <= n; k++) {
    res += n / (k * k * k);
  }
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> m;
  l = 1;
  r = 1e18;
  long long ans = -1;
  while (l <= r) {
    long long mid = l + (r - l) / 2;
    long long res = F(mid);
    if (res == m) {
      ans = mid;
      r = mid - 1;
    } else if (res > m) {
      r = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  cout << ans << endl;
  return 0;
}
