package yukicoder314; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); long[] dp=new long[n+1]; long mod=(long)Math.pow(10, 9)+7; dp[0]=0;///ケン・ケン・パ ケン・パ dp[1]=0; if(n==1){ System.out.println(1); return; } dp[2]=1; if(n==2){ System.out.println(2); return; } dp[3]=1; if(n==3){ System.out.println(2); return; } for(int i=4;i<=n;i++){ dp[i]=(dp[i-2]+dp[i-3])%mod; } System.out.println((dp[n]+dp[n-1]+dp[n-2])%mod); } }