#include<bits/stdc++.h>
using namespace std;
int jud(int n) {
int sum0 = 0, sum1 = 0, x;
while (n) {
x = n % 2;
if (x == 1)sum1++;
else sum0++;
n /= 2;
}
if (sum1 > sum0)return 1;
return 0;
}
int main() {
int sum1 = 0, sum2 = 0;
for (int i = 1; i <= 1000; i++) {
if (jud(i) == 1)sum1++;
else sum2++;
}
cout << sum1 << " " << sum2 << "\n";
return 0;
}