#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.1415926535897932384626433832795;
template <typename S, typename T>
ostream& operator<<(ostream& out, pair<S, T> const& p) {
  out << '(' << p.first << ", " << p.second << ')';
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T> const& v) {
  int l = v.size();
  for (int i = 0; i < l - 1; i++) out << v[i] << ' ';
  if (l > 0) out << v[l - 1];
  return out;
}
void tr() { cout << endl; }
template <typename S, typename... Strings>
void tr(S x, const Strings&... rest) {
  cout << x << ' ';
  tr(rest...);
}
unordered_map<long long, int> dp;
unordered_map<long long, long long> vol;
long long ans;
pair<int, long long> go(long long m) {
  if (dp.count(m)) return make_pair(dp[m], vol[m]);
  int& retc = dp[m];
  long long& retv = vol[m];
  retc = retv = 0;
  pair<int, long long> t;
  long long up = cbrt(m), x, y;
  for (int i = up; i > 0; i--) {
    int j = i + 1;
    x = 1ll * i * i * i;
    y = min(1ll * j * j * j, m + 1);
    if (dp.count(y - 1 - x) and dp[y - 1 - x] < retc) break;
    for (long long z = x, k = 1; z < y; z += x, k++) {
      t = go(y - 1 - z);
      t.first += k;
      t.second += z;
      if (t.first > retc) {
        retc = t.first;
        retv = t.second;
      } else if (t.first == retc and t.second > retv) {
        retv = t.second;
      }
    }
  }
  return make_pair(retc, retv);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long m;
  cin >> m;
  dp[0] = 0;
  pair<long long, long long> t = go(m);
  cout << t.first << ' ' << t.second << '\n';
  return 0;
}
