#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
long long a[maxn];
long long ans = 0;
pair<long long, long long> cnt[maxn];
pair<long long, long long> dfs(long long x) {
  if (x < 8) return make_pair(x, 0 * 1ll);
  int t = lower_bound(a, a + maxn, x) - a;
  if (a[t] != x) t--;
  int k = x / a[t];
  pair<long long, long long> j = cnt[t];
  if (k) {
    pair<long long, long long> i = dfs(x % a[t]);
    i.first += k;
    j.first += k - 1;
    j.second += x - (k * a[t] - 1);
    if (i.first == j.first) {
      if (i.second > j.second)
        return j;
      else
        return i;
    } else
      return (i.first > j.first) ? i : j;
  } else {
    j.second += x - (a[t] - 1);
    return j;
  }
}
int main() {
  long long m;
  for (long long i = 1; i < maxn; i++) a[i] = i * i * i;
  cnt[2] = {7, 0};
  for (long long i = 3; i < maxn; i++) cnt[i] = dfs(a[i] - 1);
  scanf("%I64d", &m);
  pair<long long, long long> ans = dfs(m);
  printf("%I64d %I64d\n", ans.first, m - ans.second);
}
