int main()
{
int money = 0;
int total = 0;
int empty = 0;
scanf("%d", &money);//20
if(money>0)
total = money*2-1;
total = money;//20
empty = money;//20
//置换
while(empty>=2)
{
total += empty/2;
empty = empty/2+empty%2;
}
printf("total = %d\n", total);
return 0;
}