#include <bits/stdc++.h>
using namespace std;
long long cube(long long n);
pair<long long, long long> cubeans(long long first);
int main() {
  pair<long long, long long> mx = make_pair(0, 0);
  long long n;
  cin >> n;
  mx = cubeans(n);
  cout << mx.first << ' ' << mx.second << endl;
  return 0;
}
long long cube(long long n) {
  long long first = 1;
  while (first * first * first <= n) first++;
  first--;
  return first;
}
pair<long long, long long> cubeans(long long first) {
  if (first < 8) return make_pair(first, first);
  long long t = cube(first), f = t + 1, g = t - 1;
  if (first >= f * f * f - 1) {
    pair<long long, long long> k = cubeans(f * f * f - t * t * t - 1);
    k = make_pair(k.first + 1, k.second + t * t * t);
    return k;
  }
  pair<long long, long long> k = cubeans(first - t * t * t);
  k = make_pair(k.first + 1, k.second + t * t * t);
  pair<long long, long long> u = cubeans(t * t * t - g * g * g - 1);
  u = make_pair(u.first + 1, u.second + g * g * g);
  return max(u, k);
}
