#include<iostream>
#include<stdio.h>
#include<algorithm>
using namespace std;
const int MAXN = 1e3 + 5;
int main()
{
int cntA = 0, cntB = 0;
for (int i = 1; i <= 1000; i++)
{
int cnt0 = 0, cnt1 = 0;
int tmp = i;
while (tmp!=0)
{
int t = tmp % 2;
if (t == 1)
cnt1++;
else
cnt0++;
tmp /= 2;
//printf("i:%d\n",i);
}
if (cnt1 > cnt0)
cntA++;
else
cntB++;
}
printf("%d %d\n", cntA, cntB);
return 0;
}