import java.util.Scanner; public class N533 { public static int count =0; public static int N=0; public static void main(String[] args) { Scanner sc=new Scanner(System.in); N=sc.nextInt(); for(int i=1;i<4;i++) { N533.step(i,0); } System.out.println(count%(int)(Math.pow(10, 9)*7)); } public static void step(int prestep,int now) { now+=prestep; if(now>=N) { count=(now==N)?count+1:count; return; } for(int i=1;i<3;i++) { int step=(prestep+i)%3; step=(step==0)?step+3:step; N533.step(step,now); } } }