#include<cstdio>
#include<cstring>
#include<math.h>
#include<stdlib.h>
#include<algorithm>
#include<ctime>
#include<iostream>
using namespace std;
const int SIZE=20;
int data[SIZE];
int n,i,h,ans;
void merge()
{
data[h-1]+=data[h];
h--;
ans++;
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("in1.txt","r",stdin);
#endif
int i,j;
cin>>n;
h=1;
data[h]=1;
ans=0;
for(i=2;i<=n;i++)
{
h++;
data[h]=1;
while(h>1&& data[h]==data[h-1]) merge();
}
cout<<ans<<endl;
//printf("%.2lf\n",(double)clock()/CLOCKS_PER_SEC);
return 0;
}
/*
*/
noip2012 阅读程序3
最新推荐文章于 2023-06-06 06:30:00 发布