#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e15 + 10;
const long long maxn = 1e5 + 10;
long long a[maxn];
vector<long long> v;
map<long long, long long> ma;
map<long long, long long> m2;
long long c(long long x) { return x * x * x; }
long long dfs(long long x) {
  long long p = 1;
  while (a[p] <= x) p++;
  p--;
  vector<long long> res;
  map<long long, long long> mk;
  long long le = x;
  while (le) {
    long long u = le / a[p];
    le -= u * a[p];
    res.push_back(p);
    mk[p] = u;
    p--;
  }
  sort(res.begin(), res.end());
  long long si = res.size();
  long long rp = 0;
  for (long long i = 0; i < si; i++) rp += mk[res[i]];
  return rp;
}
void work() {
  long long m;
  scanf("%lld", &m);
  if (m <= 7) {
    printf("%lld %lld\n", m, m);
    return;
  }
  if (m <= 13) {
    printf("7 7\n");
    return;
  }
  long long val = 7, num = 7, be = 2;
  for (long long i = 0; i < maxn; i++) {
    a[i] = i * i * i;
  }
  while (val < m) {
    long long p = c(be + 1) / a[be];
    if (val + p * a[be] > m) {
      long long sub = m - val;
      p = sub / a[be];
      val += p * a[be];
      num += p;
      v.push_back(be);
      ma[be] += p;
      break;
    }
    p = min(p, (a[be + 1] - val - 1) / a[be]);
    num += p;
    val += p * a[be];
    v.push_back(be);
    ma[be] += p;
    be++;
  }
  long long lim = INF;
  be = v.size() - 1;
  long long mp = 1, now = val;
  while (c(mp) <= m) mp++;
  mp--;
  while (be >= 0) {
    if (ma[v[be]] == 0) {
      be--;
      continue;
    }
    if (mp <= v[be]) break;
    long long u = (m - val) / (c(mp) - c(v[be]));
    u = min(u, ma[v[be]]);
    u = min(u, lim / (c(mp) - c(v[be])));
    if (u == 0) {
      mp--;
      continue;
    }
    ma[v[be]] -= u;
    ma[mp] += u;
    now += u * (c(mp) - c(v[be]));
    val += u * (c(mp) - c(v[be]));
    lim = min(lim - u * (c(mp) - c(v[be])), c(mp + 1) - now);
    now -= u * c(mp);
    mp--;
  }
  if (val + 7 <= m) {
    val += 7;
    if (dfs(val) < num) val -= 7;
  }
  printf("%lld %lld\n", num, val);
}
int main() {
  work();
  return 0;
}
