#include <bits/stdc++.h>
using namespace std;
const int K = 2000000;
pair<int, long long> d1[K];
map<long long, pair<int, long long> > d2;
long long cb(long long x) { return x * x * x; }
long long nxt(long long x) {
  int i = cbrt(x) + 1;
  while (cb(i) > x) --i;
  return i;
}
pair<int, long long> get(long long x) {
  if (x == 1) {
    return {1, 1};
  }
  if (x < K) {
    if (d1[x].first) return d1[x];
  } else {
    if (d2.count(x)) return d2[x];
  }
  long long initialX = x;
  pair<int, long long> best = {0, 0};
  for (int III = 0; III < (int)(150); ++III) {
    if (x == 0) break;
    int i = nxt(x);
    long long rem = x - cb(i);
    pair<int, long long> t = get(rem);
    ++t.first;
    t.second += cb(i);
    best = max(best, t);
    assert(best.second <= initialX);
    x = cb(i) - 1;
  }
  if (initialX < K) {
    return d1[initialX] = best;
  } else {
    return d2[initialX] = best;
  }
}
long long score(long long x) {
  int c = 0;
  while (x) {
    int i = nxt(x);
    x -= cb(i);
    ++c;
  }
  return c;
}
long long f(long long x) {
  long long bv = x;
  long long best = score(x);
  for (int i = 0; i < (int)(2000000); ++i) {
    --x;
    if (x == 0) break;
    long long t = score(x);
    if (t > best) best = t, bv = x;
  }
  return bv;
}
int main() {
  while (true) {
    long long x;
    if (!(cin >> x)) break;
    auto t = get(x);
    cout << t.first << " " << t.second << endl;
    break;
  }
  return 0;
}
