#include <bits/stdc++.h>
using namespace std;
const int N = 1 << 18;
long long m, cube[N], jhghajkhja, oauighgajk, middle, value, ans, curr;
long long next_value;
vector<pair<long long, long long> > v;
long long cnt[N];
long long compute(long long m) {
  long long ans = 0, i;
  while (m) {
    i = cbrt(m);
    ++ans;
    m -= i * 1ll * i * 1ll * i;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int i;
  for (i = 1; i <= 200001; i++) cube[i] = i * 1ll * i * 1ll * i;
  scanf("%lld", &m);
  curr = m;
  for (i = 1; cube[i] <= curr; i++) {
    jhghajkhja = 0;
    oauighgajk = cube[i + 1] - value;
    oauighgajk /= cube[i];
    ++oauighgajk;
    ++oauighgajk;
    while (oauighgajk - jhghajkhja > 1) {
      middle = (jhghajkhja + oauighgajk) >> 1;
      if (middle * 1ll * cube[i] <= curr &&
          value + middle * 1ll * cube[i] < cube[i + 1])
        jhghajkhja = middle;
      else
        oauighgajk = middle;
    }
    v.push_back(make_pair(i, jhghajkhja));
    value += jhghajkhja * 1ll * cube[i];
    ans += jhghajkhja;
    curr -= jhghajkhja * 1ll * cube[i];
  }
  printf("%lld ", ans);
  while (!v.empty()) {
    jhghajkhja = 0;
    oauighgajk = v.back().second + 1;
    while (oauighgajk - jhghajkhja > 1) {
      middle = (jhghajkhja + oauighgajk) >> 1;
      next_value = value;
      next_value -= middle * 1ll * cube[v.back().first];
      next_value += middle * 1ll * cube[v.back().first + 1];
      if (next_value <= m && compute(next_value) == ans)
        jhghajkhja = middle;
      else
        oauighgajk = middle;
    }
    next_value = value;
    next_value -= jhghajkhja * 1ll * cube[v.back().first];
    next_value += jhghajkhja * 1ll * cube[v.back().first + 1];
    value = next_value;
    if (jhghajkhja == 0)
      v.pop_back();
    else {
      v.back().second -= jhghajkhja;
      pair<long long, long long> p = make_pair(v.back().first + 1, jhghajkhja);
      v.push_back(p);
    }
  }
  printf("%lld\n", value);
  if (ans != compute(value)) {
    assert(false);
    printf("BAD %lld %lld\n", ans, compute(value));
  }
  return 0;
}
