#include <bits/stdc++.h>
using namespace std;
vector<long long> A = {1, 2};
int main() {
  long long n;
  cin >> n;
  if (n <= 23) {
    int ans = 0, jizz = 1;
    for (int p = 1; p <= n; p++) {
      for (int i = 0; i <= 7; i++)
        if ((p - i) % 8 == 0 && n >= i)
          if (i + (p - i) / 8 > ans) {
            ans = i + (p - i) / 8;
            jizz = p;
          }
    }
    cout << ans << ' ' << jizz << endl;
    return 0;
  }
  long long cur = 23;
  long long b = 3;
  while (cur + b * b * b <= n) {
    if (b * b * b + cur < (b + 1) * (b + 1) * (b + 1)) {
      A.push_back(b);
      cur += b * b * b;
    }
    b++;
  }
  long long a = 14;
  for (long long v : A) a += v * v * v;
  while (true) {
    long long t = A[A.size() - 1] + 1;
    long long x = a + t * t * t - (t - 1) * (t - 1) * (t - 1);
    if (x <= n) {
      A[A.size() - 1] = t;
      a = x;
    } else
      break;
  }
  long long v = A[A.size() - 1];
  long long bound = (v + 1) * (v + 1) * (v + 1) - v * v * v;
  long long pre = a - v * v * v;
  for (int i = A.size() - 2; i >= 0; i--) {
    while (true) {
      long long x = (A[i] + 1) * (A[i] + 1) * (A[i] + 1) - A[i] * A[i] * A[i];
      if (A[i] + 1 < A[i + 1] && pre + x < bound && a + x <= n) {
        A[i]++;
        a += x;
        pre += x;
      } else {
        break;
      }
    }
    long long tmp = A[i] * A[i] * A[i];
    pre -= tmp;
    bound = min((A[i] + 1) * (A[i] + 1) * (A[i] + 1) - tmp, bound - tmp);
  }
  cout << A.size() + 7 << ' ' << a << endl;
  return 0;
}
