/******************************************************************************************************
** Copyright (C) 2011.05.01 - 2013.07.01
** Author: famousDT <13730828587@163.com>
** Edit date: 2011-04-25
******************************************************************************************************/
#include <stdio.h>
#include <stdlib.h>//abs,atof(string to float),atoi,atol,atoll
#include <math.h>//atan,acos,asin,atan2(a,b)(a/b atan),ceil,floor,cos,exp(x)(e^x),fabs,log(for E),log10
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <iostream>
#include <string.h>//memcpy(to,from,count
#include <ctype.h>//character process:isalpha,isdigit,islower,tolower,isblank,iscntrl,isprint
#include <algorithm>
using namespace std;
//typedef long long int ll;
#define PI acos(-1)
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MALLOC(n, type) ((type *)malloc((n) * sizeof(type)))
#define FABS(a) ((a) >= 0 ? (a) : (-(a)))
#define MAXN 1000000
int flag[MAXN + 5];
int ans;
int gcd(int a, int b)
{
return b == 0 ? a : gcd(b, a % b);
}
void process(int value)
{
int i, j;
for (j = 1; j * j <= value; ++j) {
int minj = MIN(sqrt(value - j * j) + 1, j - 1);
for (i = 1; i <= minj; ++i) {
if (gcd(i, j) == 1) {
int x = j * j - i * i;
int y = 2 * i * j;
int z = j * j + i * i;
if (x <= value && y <= value && z <= value) {
if (gcd(gcd(x, y), z) == 1)
++ans;
}
else
break;
int times = 1;
while (x * times <= value && y * times <= value && z * times <= value) {
flag[x * times] = flag[y * times] = flag[z * times] = 1;
++times;
}
}
}
}
}
int main()
{
int n;
while (cin>>n) {
ans = 0;
memset(flag, 0, sizeof(int));
int i;
int sum = 0;
process(n);
for (i = 0; i <= n; ++i)
if (flag[i])
++sum;
printf("%d %d\n", ans, n -sum);
}
return 0;
}