#include<iostream>
using namespace std;
bool pd(int n);
int main(){
int n=0;
cin>>n;
int a=0,b=0;
for(int i=1;i<=n;i++){
if(pd(i))
a++;
else
b++;
}
cout<<a<<" "<<b;
}
bool pd(int n){
int x=n;
int y=0;
int a=0,b=0;
while(x!=0){
y=x%2;
x=x/2;
if(y==0)
b++;
else
a++;
}
if(a>b)
return true;
else
return false;
}
/**************************************************************
Problem: 1141
User: linyuhang
Language: C++
Result: Accepted
Time:14 ms
Memory:2072 kb
****************************************************************/