#include<bits/stdc++.h>
using namespace std;
int ss(int q){
    int i,a=0,b=0,x;
    while(q!=0){
        x=q%2;
        if(x==0) a++;
        else b++;
        q=q/2;  
    }
    if(b>a)
    return 1;
    else
    return 0;
}
int main()
{
    int i,q,n,a=0,b=0;
    cin>>n;
    for(i=1;i<=n;i++){
        if(ss(i)==1)
        a++;
        else
        b++;
    }
    cout<<a<<" "<<b;
    return 0;
}
 

/**************************************************************
	Problem: 1141
	User: fuyijun
	Language: C++
	Result: Accepted
	Time:9 ms
	Memory:2072 kb
****************************************************************/