1000000000000000
 994
 200385
 3842529393411
 8
 409477218238717
 2
 419477218238718
 909383000
 7
 999088000000000
 265
 415000000238718
 780869426483087
 9
 850085504652042
 567000123
 980123123123123
 409477218238719
 385925923480002
 999998169714888
 936302451686999
 114
 999999993700000
 108000000057
 409477218238716
 112
 1
 409477218238718
 999971000299999
 409477318238718
 735412349812385
 113
 999999999999999
 123830583943
 899990298504716
 936302451687000
 995
 990000000000000
 936302451687001
 999986542686123
 850085504652041

18 999999993541753
 12 941
 14 200355
 17 3842529383076
 7 7
 17 409477218238717
 2 2
 18 419466459294818
 16 909381874
 7 7
 18 999087986204952
 11 212
 18 414993991790735
 18 780869407920631
 7 7
 18 850085504652042
 16 566998782
 18 980123123116482
 18 409477218238718
 17 385925923479720
 18 999998150030846
 18 936302448662019
 11 114
 18 999999993541753
 17 107986074062
 17 409477218238710
 10 106
 1 1
 18 409477218238718
 18 999969994441746
 18 409477218238718
 18 735409591249436
 10 113
 18 999999993541753
 17 123830561521
 18 899973747835553
 18 936302448662019
 12 995
 18 989983621692990
 18 936302448662019
 18 999969994441746
 18 850085504650655

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.PrintStream;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;

/*
 public class _780D {

 }

 */

public class _780D {
  public void solve() throws FileNotFoundException {
    InputStream inputStream = System.in;

    InputHelper inputHelper = new InputHelper(inputStream);

    PrintStream out = System.out;

    // actual solution

    // long[] dp = new long[100001];
    // long[] cube = new long[100001];
    // long[] ans = new long[100001];
    //
    // dp[1] = 0;
    // cube[1] = 1;
    // ans[1] = 0;
    // dp[2] = 7;
    // cube[2] = 8;
    // ans[2] = 7;
    //
    // for (int i = 3; i <= 100000; i++) {
    // cube[i] = (long) i * i * i;
    //
    // long diff = cube[i] % cube[i - 1];
    // long q = cube[i] / cube[i - 1];
    //
    // if (diff <= dp[i - 1]) {
    // q--;
    // }
    //
    // dp[i] = q * cube[i - 1] + dp[i - 1];
    // ans[i] = q + ans[i - 1];
    // }

    long n = inputHelper.readLong();

    // long mxt = Long.MIN_VALUE;
    // long x = -1;
    //
    // for (int i = 100000; i >= 2; i--) {
    // if (dp[i] <= n) {
    // long cn = Math.min(n, cube[i] - 1);
    //
    // long diff = cn % cube[i];
    // long q = cn / cube[i];
    //
    // if (diff < dp[i]) {
    // if (diff == dp[i] - 1) {
    // long cv = q * cube[i] + dp[i] - 1;
    // long cans = q + ans[i] - 1;
    // if (cans > mxt) {
    // mxt = cans;
    // x = cv;
    // }
    // continue;
    // }
    // q--;
    // }
    //
    // long cv = q * cube[i] + dp[i];
    // long cans = q + ans[i];
    //
    // if (cans > mxt) {
    // mxt = cans;
    // x = cv;
    // }
    // }
    // }

    ans ans = rec(n);
    System.out.println(ans.t + " " + ans.x);
    // end here
  }

  class ans {
    long t;
    long x;

    public ans(long t, long x) {
      super();
      this.t = t;
      this.x = x;
    }
  }

  ans rec(long n) {

    if (n < 8) {
      return new ans(n, n);
    }

    long cbrt = (long) Math.cbrt(n);

    long cb = (long) Math.pow(cbrt, 3);

    // check with cbrt
    long q = n / cb;
    long rem = n % cb;
    ans ans1 = cal(rec(rem), q * cb, q);

    if (q > 1) {
      ans1 = max(ans1, cal(rec(n - cb * (q - 1)), (q - 1) * cb, q - 1));
    }

    cbrt--;

    n = Math.min(n, cb - 1);
    
    cb = (long) Math.pow(cbrt, 3);

    q = n / cb;
    rem = n % cb;

    ans1 = max(ans1, cal(rec(rem), q * cb, q));

    if (q > 1) {
      ans1 = max(ans1, cal(rec(n - cb * (q - 1)), (q - 1) * cb, q - 1));
    }

    return ans1;
  }

  ans max(ans ans1, ans ans2) {
    if (ans1.t > ans2.t) {
      return ans1;
    } else if (ans1.t < ans2.t) {
      return ans2;
    } else if (ans1.x >= ans2.x) {
      return ans1;
    } else {
      return ans2;
    }
  }

  ans cal(ans ans1, long x, long t) {
    ans ans = new ans(ans1.t + t, ans1.x + x);
    return ans;
  }

  public static void main(String[] args) throws FileNotFoundException {
    (new _780D()).solve();
  }

  class InputHelper {
    StringTokenizer tokenizer = null;
    private BufferedReader bufferedReader;

    public InputHelper(InputStream inputStream) {
      InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
      bufferedReader = new BufferedReader(inputStreamReader, 16384);
    }

    public String read() {
      while (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          String line = bufferedReader.readLine();
          if (line == null) {
            return null;
          }
          tokenizer = new StringTokenizer(line);
        } catch (IOException e) {
          e.printStackTrace();
        }
      }

      return tokenizer.nextToken();
    }

    public Integer readInteger() {
      return Integer.parseInt(read());
    }

    public Long readLong() {
      return Long.parseLong(read());
    }
  }
}
