#include <bits/stdc++.h>
using namespace std;
long long m, sum[100005], lim[100005], hd, i, dp[100020], ph[100005],
    mx1[100005], mx2[100005], pos;
const long long mx = 100000;
long long solve2(long long p, long long pos, long long len);
long long solve(long long p, long long pos, long long len);
long long solve3(long long p, long long pos, long long posb, long long len) {
  long long ans, tmp, pos2, ans2;
  if (pos == 1) return p;
  if (mx2[posb]) return mx2[posb];
  if (dp[len] <= sum[pos - 1])
    ans = solve2(sum[pos - 1], pos - 1, len);
  else
    ans = 0;
  tmp = p - pos * pos * pos;
  if (dp[len - 1] > tmp)
    ans2 = 0;
  else {
    pos2 = lower_bound(sum + 1, sum + mx + 1, tmp) - sum;
    if (sum[pos2] == tmp)
      ans2 = pos * pos * pos + solve2(tmp, pos2, len - 1);
    else
      ans2 = pos * pos * pos + solve(tmp, pos2, len - 1);
  }
  return mx2[posb] = max(ans, ans2);
}
long long solve2(long long p, long long pos, long long len) {
  long long pos2;
  if (mx1[pos]) return mx1[pos];
  if (pos == 1) return mx1[pos] = 7;
  pos2 = lower_bound(sum + 1, sum + mx + 1, lim[pos]) - sum;
  if (sum[pos2] == lim[pos])
    mx1[pos] = ph[pos] + solve2(lim[pos], pos2, len - 1);
  else
    mx1[pos] = ph[pos] + solve3(lim[pos], pos2, pos, len - 1);
  return mx1[pos];
}
long long solve(long long p, long long pos, long long len) {
  long long ans, tmp, pos2, ans2;
  if (pos == 1) return p;
  if (dp[len] <= sum[pos - 1])
    ans = solve2(sum[pos - 1], pos - 1, len);
  else
    ans = 0;
  tmp = p - pos * pos * pos;
  if (dp[len - 1] > tmp)
    ans2 = 0;
  else {
    pos2 = lower_bound(sum + 1, sum + mx + 1, tmp) - sum;
    if (sum[pos2] == tmp)
      ans2 = pos * pos * pos + solve2(tmp, pos2, len - 1);
    else
      ans2 = pos * pos * pos + solve(tmp, pos2, len - 1);
  }
  return max(ans, ans2);
}
int main() {
  scanf("%lld", &m);
  if (m <= 7) {
    printf("%lld %lld\n", m, m);
    return 0;
  }
  sum[1] = 7;
  for (i = 2; i <= mx; i++) sum[i] = (i + 1) * (i + 1) * (i + 1) - 1;
  for (i = 1; i <= mx; i++) ph[i] = i * i * i;
  for (i = 1; i <= 7; i++) dp[i] = i;
  for (i = 1; i <= mx; i++)
    lim[i] = (i + 1) * (i + 1) * (i + 1) - i * i * i - 1;
  hd = 7;
  for (i = 2; i <= mx; i++)
    while (dp[hd] <= lim[i]) dp[hd + 1] = i * i * i + dp[hd], hd++;
  while (dp[hd] > m) hd--;
  printf("%lld ", hd);
  pos = lower_bound(sum + 1, sum + mx + 1, m) - sum;
  if (sum[pos] == m)
    printf("%lld\n", solve2(m, pos, hd));
  else
    printf("%lld\n", solve(m, pos, hd));
  return 0;
}
