#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<set>
#define ll long long
using namespace std;
const int maxn = 1001000;
const int inf = 0x3f3f3f3f;
#define PI 3.141592653589
#define fr(i,r,l) for(int i=r;i<=l;i++)
ll a[maxn];
ll b[maxn];
int main()
{
int sum = 0, ans = 0;
fr(i, 1, 1000)
{
int aq = 0, qw = 0;
int n = i;
while (n)
{
if (n % 2 == 1)
aq++;
else qw++;
n = n / 2;
}
if (aq > qw)
{
sum++;
}
else ans++;
}
cout << sum << ' ' << ans << endl;
}