#include "stdio.h"
#include "math.h"

int main()
{
  int n, i, ans, x=0, exp=5;
  scanf ("%d",&n);
  int f=n-1;
  double result;
  for (i=0; i<=n; i++)
    {
      result=pow(x,5);
      if (result == f)
        {
          ans=i;
          break;
        }
      x++;
    }
  printf ("%d -1\n",ans);
  return 0;
}