#include <bits/stdc++.h>
using namespace std;
#define LL long long
const int N = 2e6 + 101;
int n;
int num[N][21], siz[N], res[101];
int ans, ans2;
int main()
{
scanf("%d",&n);
for(int i = 1;i <= n; i++)
for(int j = i;j <= n; j+=i)
num[j][++ siz[j]] = i;
ans = (ans ^ ((1 + 1) ^ 1));ans2 = 1;
for(int b = 2;b <= n; b++) //
{
int x = b - 1,y = b + 1, tot = 0;
for(int j = 1;j <= siz[x]; j++)
res[++ tot] = num[x][j];
for(int j = 1;j <= siz[y]; j++)
res[++ tot] = num[y][j];
sort(res + 1,res + tot + 1);
tot = unique(res + 1,res + tot + 1) - res;
for(int i = 1;i <= tot; i++)
{
LL a1 = res[i],a2 = (LL) (b - 1) * (LL) (b + 1) / (LL) res[i], x1, x2;
if(a1 > sqrt((LL)b * (LL)b - 1)) break;
x1 = max(a1,a2);x2 = min(a1,a2);
if((x1 + x2) % 2 != 0 || (x1 - x2) % 2 != 0) continue;
LL a = (x1 - x2) / 2,c = (x1 + x2) / 2;
if(a > b || c < b) continue;
if(a + b + c > n) continue;
ans = (ans ^ ((a + b) ^ c)); ++ ans2;
}
}
cout << ans << ' ' << ans2 << endl;
}