#include<iostream>
#include<cstdio>
using namespace std;
unsigned long long ksm(unsigned long long X)
{
unsigned long long p=999999997LL,a=2,ans=1;
while(X>0)
{
if(X%2==1)
ans=ans*a%p;
a=a*a%p;
X=X/2;
}
return ans;
}
int main()
{
freopen("Hanoia.in","r",stdin);
freopen("Hanoia.out","w",stdout);
unsigned long long n;
cin>>n;
cout<<ksm(n)-1;
return 0;
}