#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
long long Cubic[N], m;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  cin >> m;
  for (long long i = 1; i < N; i++) {
    Cubic[i] = i * i * i;
    if (Cubic[i] > 2 * m) break;
  }
  long long x = 0, idx = 1, ans = 0;
  vector<long long> v;
  while (x <= m) {
    while (x + Cubic[idx] >= Cubic[idx + 1] && x + Cubic[idx] <= m) {
      ++idx;
    }
    if (x + Cubic[idx] > m) break;
    x += Cubic[idx], ans++;
    v.push_back(idx);
  }
  int sz = v.size();
  for (int i = sz - 1; i >= 0; i--) {
    while (true) {
      long long add = Cubic[v[i] + 1] - Cubic[v[i]], now = 0;
      v[i]++;
      bool valid = 1;
      for (int j = 0; j < sz; j++) {
        now += Cubic[v[j]];
        if (now >= Cubic[v[j] + 1]) {
          valid = 0;
          break;
        }
      }
      if (valid && now <= m)
        x += add;
      else {
        --v[i];
        break;
      }
    }
  }
  cout << ans << " " << x << "\n";
}
