#include <bits/stdc++.h>
#define ll long long int
#define N 101
#define mod 1000000007
using namespace std;
ll a[N][N] = {0},I[N][N];
void mul(ll A[][N], ll B[][N], ll dim)
{
ll res[dim+1][dim+1];
for (ll i = 0 ; i < dim; i++)
{
for (ll j = 0 ; j < dim; j++)
{
res[i][j] = 0;
for (ll k = 0; k < dim; k++)
{
res[i][j] = ((res[i][j]) + (A[i][k] * B[k][j])%mod ) % mod;
}
}
}
for (ll i = 0 ; i < dim; i++)
{
for (ll j = 0; j < dim; j++)
{
A[i][j] = res[i][j];
}
}
}
void power(ll A[][N], ll dim, ll n)
{
for (ll i = 0 ; i < dim; i++)
{
for(ll j = 0 ; j < dim;j++)
{
if (i == j)
I[i][j] = 1;
else
I[i][j] = 0;
}
}
while(n > 0)
{
if(n % 2)
{
mul(I, A,dim);
}
mul(A,A,dim);
n /= 2;
}
for (ll i = 0 ; i < dim; i++)
for (ll j = 0; j < dim; j++)
A[i][j] = I[i][j];
}
int main()
{
ll n;
cin >> n;
for(ll i = 0;i < 6;i++)
a[i][5] = 1;
a[1][0] = 1;
a[2][1] = 1;
a[3][2] = 1;
a[4][3] = 1;
a[5][4] = 1;
power(a, 6, n-1);
cout << 2 * a[1][0];
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgbGwgbG9uZyBsb25nIGludAojZGVmaW5lIE4gMTAxCiNkZWZpbmUgbW9kIDEwMDAwMDAwMDcKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmxsIGFbTl1bTl0gPSB7MH0sSVtOXVtOXTsKdm9pZCBtdWwobGwgQVtdW05dLCBsbCBCW11bTl0sIGxsIGRpbSkKewogICAgbGwgcmVzW2RpbSsxXVtkaW0rMV07CiAgICBmb3IgKGxsIGkgPSAwIDsgaSA8IGRpbTsgaSsrKQogICAgewogICAgICAgIGZvciAobGwgaiA9IDAgOyBqIDwgZGltOyBqKyspCiAgICAgICAgewogICAgICAgICAgICByZXNbaV1bal0gPSAwOwogICAgICAgICAgICBmb3IgKGxsIGsgPSAwOyBrIDwgZGltOyBrKyspCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIHJlc1tpXVtqXSA9ICgocmVzW2ldW2pdKSArIChBW2ldW2tdICogQltrXVtqXSklbW9kICkgJSBtb2Q7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CgogICAgZm9yIChsbCBpID0gMCA7IGkgPCBkaW07IGkrKykKICAgIHsKICAgICAgICBmb3IgKGxsIGogPSAwOyBqIDwgZGltOyBqKyspCiAgICAgICAgewogICAgICAgICAgICBBW2ldW2pdID0gcmVzW2ldW2pdOwogICAgICAgIH0KICAgIH0KfQp2b2lkIHBvd2VyKGxsIEFbXVtOXSwgbGwgZGltLCBsbCBuKQp7CiAgICBmb3IgKGxsIGkgPSAwIDsgaSA8IGRpbTsgaSsrKQogICAgewogICAgICAgIGZvcihsbCBqID0gMCA7IGogPCBkaW07aisrKQogICAgICAgIHsKICAgICAgICAgICAgaWYgKGkgPT0gaikKICAgICAgICAgICAgICAgIElbaV1bal0gPSAxOwogICAgICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICBJW2ldW2pdID0gMDsKICAgICAgICB9CiAgICB9CgogICAgd2hpbGUobiA+IDApCiAgICB7CiAgICAgICAgaWYobiAlIDIpCiAgICAgICAgewogICAgICAgICAgICBtdWwoSSwgQSxkaW0pOwogICAgICAgIH0KICAgICAgICBtdWwoQSxBLGRpbSk7CiAgICAgICAgbiAvPSAyOwogICAgfQoKICAgIGZvciAobGwgaSA9IDAgOyBpIDwgZGltOyBpKyspCiAgICAgICAgZm9yIChsbCBqID0gMDsgaiA8IGRpbTsgaisrKQogICAgICAgICAgICBBW2ldW2pdID0gSVtpXVtqXTsKfQppbnQgbWFpbigpCnsKICAgIGxsIG47CiAgICBjaW4gPj4gbjsKICAgIGZvcihsbCBpID0gMDtpIDwgNjtpKyspCiAgICAgICAgYVtpXVs1XSA9IDE7CiAgICBhWzFdWzBdID0gMTsKICAgIGFbMl1bMV0gPSAxOwogICAgYVszXVsyXSA9IDE7CiAgICBhWzRdWzNdID0gMTsKICAgIGFbNV1bNF0gPSAxOwoKICAgIHBvd2VyKGEsIDYsIG4tMSk7CiAgICBjb3V0IDw8IDIgKiBhWzFdWzBdOwogICAgcmV0dXJuIDA7Cn0K