#include <bits/stdc++.h>
using namespace std;
unsigned long long ways(unsigned long long n) {
  unsigned long long res = 0, kl = 0;
  for (int k = (2); k < (300000); k++) {
    kl = k;
    unsigned long long tmp = kl * kl * kl;
    if (tmp > n) break;
    res += n / tmp;
  }
  return res;
}
int main() {
  unsigned long long m;
  scanf("%I64d", &m);
  unsigned long long candidateResponse = -1;
  unsigned long long from = 1, to = 1e18;
  while (from <= to) {
    unsigned long long mid = (to + from) / 2;
    unsigned long long res = ways(mid);
    if (res > m) {
      to = mid - 1;
    } else if (res < m) {
      from = mid + 1;
    } else if (ways(mid - 1) == res) {
      to = mid - 1;
    } else {
      candidateResponse = mid;
      break;
    }
  }
  printf("%I64d", candidateResponse);
  return 0;
}
