#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
inline long long cb(long long x) { return x * x * x; }
long long x, sum(0);
vector<long long> used;
inline bool ok(long long now, int pos) {
  long long tot = sum - cb(used[pos]) + cb(now);
  if (tot > x) return false;
  for (int i = 0, _n = (pos); i != _n; i++) {
    if (tot >= cb(used[i] + 1)) return false;
    tot -= cb(used[i]);
  }
  return true;
}
int main() {
  cin >> x;
  long long cur(1);
  while (sum + cb(cur) <= x) {
    if (sum + cb(cur) < cb(cur + 1)) {
      sum += cb(cur);
      used.emplace_back(cur);
    } else
      cur++;
  }
  cout << used.size() << " ";
  reverse((used).begin(), (used).end());
  long long pre, now;
  for (int i = 0, _n = (used.size()); i != _n; i++) {
    pre = now = used[i];
    while (ok(now + 1, i)) now++;
    sum += cb(now) - cb(pre);
    used[i] = now;
  }
  cout << sum << "\n";
  return 0;
}
