//@begin_of_source_code

/*@JUDGE_ID: 15975FF 106 C++*/

#include<iostream.h>

#include<math.h>

int gcd( int a, int b)

{

int r;

do

{

r = a % b;

a = b;

b = r;

}while(r!=0);

return a;

}

int main()

{

long int N;

int t,s;

int n,m;

int i;

long int x,y;

long int z;

int count, count1;

bool B[1000001];

for( i = 0;i <=1000000; i++)

B

*= false;*

while( cin>>N)

{

count = 0;

n=1;

t=n*n;

while(t < N)

{

m = n+1;

z = t+m*m;

while(z <= N)

{

x = m*m-n*n;

y = 2*m*n;

//cout << "found" << endl;

//cout<<x<<' '<<y<<' '<<z<< endl;

if(gcd (x,y) ==1)

{

if(gcd (y,z) ==1)

{

if(gcd (x,z) ==1)

{

//cout << "accept" << endl;

//cout<<x<<' '<<y<<' '<<z<< endl;

count ++;

B[x] = true;

B[y] = true;

B[z] = true;

i = 2;

s = i * z;

while(s <= N)

{

//cout << "eliminating" << endl;

//cout<<x*i<<' '<<y*i<<' '<<s<< endl;

B[s] = true;

B[i*x] = true;

B[i*y] = true;

i++;

s = i * z;

}

}

}

}

//cout <<x <<' '<<y<<' '<<z<<endl;

m++;

z = t+m*m;

}

n++;

t = n*n;

}

count1 = 0;

for( i = 1;i <=N; i++)

if(!B

while( cin>>N)

{

count = 0;

n=1;

t=n*n;

while(t < N)

{

m = n+1;

z = t+m*m;

while(z <= N)

{

x = m*m-n*n;

y = 2*m*n;

//cout << "found" << endl;

//cout<<x<<' '<<y<<' '<<z<< endl;

if(gcd (x,y) ==1)

{

if(gcd (y,z) ==1)

{

if(gcd (x,z) ==1)

{

//cout << "accept" << endl;

//cout<<x<<' '<<y<<' '<<z<< endl;

count ++;

B[x] = true;

B[y] = true;

B[z] = true;

i = 2;

s = i * z;

while(s <= N)

{

//cout << "eliminating" << endl;

//cout<<x*i<<' '<<y*i<<' '<<s<< endl;

B[s] = true;

B[i*x] = true;

B[i*y] = true;

i++;

s = i * z;

}

}

}

}

//cout <<x <<' '<<y<<' '<<z<<endl;

m++;

z = t+m*m;

}

n++;

t = n*n;

}

count1 = 0;

for( i = 1;i <=N; i++)

if(!B

*)*

{

//cout << i <<' '<<i*i << endl;

count1++;

}

cout << count << ' ' << count1 << endl;;

//cout << "done"<<endl;

}

return 0;

}

//@end_of_source_code{

//cout << i <<' '<<i*i << endl;

count1++;

}

cout << count << ' ' << count1 << endl;;

//cout << "done"<<endl;

}

return 0;

}

//@end_of_source_code