#include <bits/stdc++.h>
using namespace std;
inline long long cube(long long x) { return x * x * x; }
vector<long long> num_blocks(long long m) {
  long long block = 1;
  long long sz = 0;
  vector<long long> ret;
  while (sz + cube(block) <= m) {
    while (sz + cube(block) <= m &&
           (sz + cube(block) < cube(block + 1) || cube(block + 1) > m)) {
      sz += cube(block);
      ret.push_back(block);
    }
    ++block;
  }
  return ret;
}
long long get_sum(const vector<long long> &v) {
  long long ret = 0;
  for (long long x : v) ret += cube(x);
  return ret;
}
bool ok(const vector<long long> &v) {
  long long r = 0;
  for (long long a : v) {
    r += cube(a);
    if (r >= cube(a + 1)) return false;
  }
  return true;
}
int main() {
  long long m;
  cin >> m;
  vector<long long> blocks = num_blocks(m);
  long long sum = get_sum(blocks);
  for (int i = blocks.size() - 1; i >= 0; --i) {
    while (true) {
      if (sum - cube(blocks[i]) + cube(blocks[i] + 1) <= m) {
        blocks[i]++;
        if (ok(blocks)) {
          sum = sum - cube(blocks[i] - 1) + cube(blocks[i]);
        } else {
          --blocks[i];
          break;
        }
      } else
        break;
    }
  }
  cout << int(blocks.size()) << " " << sum << "\n";
  return 0;
}
