step[4];
main(n){
step[0]=1;
scanf("%d",&n);
for(;n--;){
step[3]=step[2];
step[2]=step[1];
step[1]=step[0];
step[0]=(step[2]+step[3])%1000000007;
}
return !printf("%d",((step[0]+step[1])%1000000007+step[2])%1000000007);
}