#include using namespace std; const int MOD7 = ( int ) 1e9 + 7; typedef vector< int > vi; typedef vector< vi > vvi; signed main(){ int N; cin >> N; vvi dp = vvi( N + 1, vi( 3 ) ); dp[ 0 ][ 0 ] = 1; for( int i = 0; i < N; ++i ) ( dp[ i + 1 ][ 0 ] += dp[ i + 1 ][ 1 ] + dp[ i + 1 ][ 2 ] ) %= MOD7, ( dp[ i + 1 ][ 1 ] += dp[ i + 1 ][ 0 ] ) %= MOD7, ( dp[ i + 1 ][ 2 ] += dp[ i + 1 ][ 1 ] ) %= MOD7; cout << ( ( dp[ N ][ 0 ] + dp[ N ][ 1 ] ) % MOD7 + dp[ N ][ 2 ] ) % MOD7 << endl; return 0; }