#include <bits/stdc++.h>
using namespace std;
int A, B;
int main() {
for (int i = 1; i <= 1000; ++i) {
int One = 0, Zero = 0, x = i;
while (x) {
if (x & 1) {
One++;
} else {
Zero++;
}
x >>= 1;
}
if (One > Zero) {
++A;
} else {
++B;
}
}
printf("%d %d\n", A, B);
return 0;
}