#include<bits/stdc++.h>
using namespace std;

//10进制转2进制 
int n; 
string r = "";//存放转换结果 
int c0 = 0,c1 = 0; 
int main(){
	cin>>n;
	if(n == 0){
		cout<<1<<" "<<0<<endl;
		return 0;
	}
	
	//当n!=0循环
	while(n != 0){
		//cout<<n%2;//取余 
		//将n%2的结果转换为字符+到r前面
		//r = char(n%2+'0') + r; 
		if(n % 2 == 0) c0++;
		else c1++;
		n=n/2;//除2 
	} 
	
	//特判输入为0的情况 
	cout<<c0<<" "<<c1<<endl;
    return 0;
} 
/**************************************************************
	Problem: 2066
	User: admin
	Language: C++
	Result: Accepted
	Time:21 ms
	Memory:2072 kb
****************************************************************/