#include #include #define rep( i, n, m ) for(ll i = ( n ); i < ( m ); i++) using ll = long long int; int give_water( int* array, int begin, int end ); int main( void ){ int n; if (!scanf( "%d", &n )) return 0; if (n < 7){ if (n < 3) printf( "%d\n", n ); else printf( "%d\n", n - 1 ); return 0; } int times = ( n - 6 ) / 2; ll array[] = {1, 2, 2}; rep( i, 0, times ){ int a = 0, b = 0, c = 0; a = array[ 1 ]; b = array[ 1 ] + array[ 2 ]; c = array[ 0 ] + array[ 2 ]; array[ 0 ] = a%1000000007; array[ 1 ] = b%1000000007; array[ 2 ] = c%1000000007; } if (n % 2 != 0){ array[ 2 ] *= 2; } ll sum = 0; rep( i, 0, 3 ){ sum += array[ i ]; sum %= 1000000007; } printf( "%d\n", sum ); return 0; }