#include<iostream>
#include<cstdio>
#include<vector>
using namespace std;
int main(){
freopen("abnum.in","r",stdin);
freopen("abnum.out","w",stdout);
int num;
cin>>num;
int A=0,B=0;
for (int i=1;i<=num;i++){
int t=i;
int num1=0,num0=0;
while (t!=0){
int temp=t&1;
if (temp==1) num1++;
else num0++;
t=t>>1;
}
if (num1>num0) A++;
else B++;
}
cout<<A<<" "<<B<<endl;
return 0;
}