/*   @JUDGE_ID:   1705PZ   106   C */
#include <stdio.h>
#define SIZE 1000

int check(long i,long j,long k){
while(i != j){
	if(i > j)
		i -= j;
	else
		j -= i;
	}
while(i != k){
	if(i > k)
		i -= k;
	else
		k -= i;
	}
if(i == 1)
	return 1;
else
	return 0;
}

int main(){
long i,j,k;
long n;
int array[SIZE];
int count,count1;
while(scanf("%ld",&n) == 1){
	count = 0;
	count1 = 0;
	for(i = 0;i < SIZE;i++)
		array[i] = 0;
	for(i = 1;i <= n;i++)
		for(j = i;j <= n;j++)
			for(k = j;k <= n;k++)
				if(i * i + j * j == k * k){
					array[i] = 1;
					array[j] = 1;
					array[k] = 1;
					if(check(i,j,k))
						count++;
					}
	for(i = 1;i <= n;i++)
		if(array[i] == 0)
			count1++;
	printf("%d %d\n",count,count1);
	}
return 0;
}
@END_OF_SOURCE_CODE

