#include <bits/stdc++.h>
using namespace std;
inline long long g(long long x) { return x * x * x; }
long long res[100010];
long long Count;
long long cube[100010];
long long sum = 0;
long long get_cnt(long long x) {
  long long ans = 0;
  for (long long i = pow(x, 1 / 3.0); i >= 1; i = pow(x, 1 / 3.0)) {
    while (x >= cube[i]) x -= cube[i], ans++;
  }
  return ans;
}
long long cnt = 0;
int main() {
  long long m;
  const int M = 100000;
  cin >> m;
  for (int i = 1; i <= M; ++i) cube[i] = i * 1ll * i * i;
  long long sum = 0;
  for (long long i = 1; i <= M; ++i) {
    long long x = cube[i + 1];
    long long y = cube[i];
    if (sum + y > m) break;
    while (sum + y < x && sum + y <= m) {
      res[++Count] = i;
      sum += y;
    }
  }
  for (int i = Count; i >= 1; --i) {
    while (sum - cube[res[i]] + cube[res[i] + 1] <= m &&
           get_cnt(sum - cube[res[i]] + cube[res[i] + 1]) == Count) {
      sum -= cube[res[i]];
      sum += cube[res[i] + 1];
      res[i]++;
    }
  }
  cout << Count << ' ' << sum << "\n";
  return 0;
}
