Lucky Numbers(acm)

B - Lucky Numbers
Time Limit:500MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u
Submit  Status

Description

The numbers of all offices in the new building of the Tax Office of IT City will have lucky numbers.

Lucky number is a number that consists of digits 7 and 8 only. Find the maximum number of offices in the new building of the Tax Office given that a door-plate can hold a number not longer than n digits.

Input

The only line of input contains one integer n (1 ≤ n ≤ 55) — the maximum length of a number that a door-plate can hold.

Output

Output one integer — the maximum number of offices, than can have unique lucky numbers not longer than n digits.

Sample Input

Input
2
Output

6


位数为1   2   3……的时候组成的数是2    4    8    16……


代码:

#include<stdio.h>
#include<math.h>
int main()
{
int n;
double m;
__int64 s;
while(~scanf("%d",&n))
{
s=0;
for(int i=1;i<=n;i++)
{
m=pow(2.0,i);//2的i次方 ,用pow浮点型
s+=m;
}
printf("%I64d\n",s);
}
return 0;
 } 

你可能感兴趣的:(Lucky Numbers(acm))