#include <bits/stdc++.h>
using namespace std;
int solve(long long n) {
  int mid, l = 1, r = 100002, ans;
  while (l <= r) {
    mid = l + r >> 1;
    if (1LL * mid * mid * mid > n) {
      r = mid - 1;
    } else {
      ans = mid;
      l = mid + 1;
    }
  }
  return ans;
}
long long ans1 = 0, ans2 = 0;
void dfs(long long n, long long cot, long long sum) {
  if (n <= 7) {
    if (ans1 < cot + n || (ans1 == cot + n) && (sum + n > ans2)) {
      ans1 = n + cot;
      ans2 = sum + n;
    }
    return;
  }
  int sq = solve(n);
  dfs(n - 1LL * sq * sq * sq, cot + 1, sum + 1LL * sq * sq * sq);
  dfs(1LL * sq * sq * sq - 1 - 1LL * (sq - 1) * (sq - 1) * (sq - 1), cot + 1,
      sum + 1LL * (sq - 1) * (sq - 1) * (sq - 1));
}
int main() {
  long long n;
  scanf("%lld", &n);
  dfs(n, 0, 0);
  printf("%lld %lld\n", ans1, ans2);
  return 0;
}
