#include #define MOD 1000000007 int main(void) { int n, i, dp[3] = {0, 1, 0}; scanf("%d", &n); for(i = 1; i < n; i++) { int temp[3] = { dp[0], dp[1], dp[2] }; dp[0] = ( temp[1] + temp[2] ) % MOD; dp[1] = temp[0]; dp[2] = temp[1]; } printf("%d\n", ( dp[0] + dp[1] + dp[2] ) % MOD ); return 0; }