#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 7;
const long long mod = 1e9 + 7;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  vector<pair<long long, long long> > vc;
  long long i = 1;
  for (long long j = 2; j <= 1e5; j++) {
    vc.push_back({j * j * j - i * i * i, i});
    i = j;
  }
  sort(vc.begin(), vc.end());
  vector<long long> v;
  long long cnt = 0, c = 0, m, ans = 0, mx = 0;
  cin >> m;
  for (long long i = 0; i < 100; i++) {
    auto it = upper_bound(vc.begin(), vc.end(), make_pair(cnt, 2ll));
    if (it == vc.end()) {
      break;
    }
    long long ind = it - vc.begin();
    cnt += vc[ind].second * vc[ind].second * vc[ind].second;
    c++;
    if (cnt <= m) {
      ans = c;
      mx = cnt;
      v.push_back(vc[ind].second);
    } else {
      break;
    }
  }
  sort(v.begin(), v.end());
  for (long long i = (long long)v.size() - 1; i >= 0; i--) {
    long long now = v[i];
    long long res = mx - now * now * now;
    while (res + (now + 1) * (now + 1) * (now + 1) <= m) {
      long long pr = v[i], ok = 1;
      v[i] = now + 1;
      long long total = 0;
      for (long long j = 0; j < (long long)v.size(); j++) {
        total += v[j] * v[j] * v[j];
        if (total >= (v[j] + 1) * (v[j] + 1) * (v[j] + 1)) {
          ok = 0;
          break;
        }
      }
      v[i] = pr;
      if (ok) {
        now++;
      } else {
        break;
      }
    }
    mx = res + now * now * now;
    v[i] = now;
  }
  cout << ans << ' ' << mx;
}
