mint d[1000010][4],z;ll n; {rd(n);d[0..2][0..2]=1; rep(i,1,n){ d[i+1][0]+=d[i][1]+d[i][2]; d[i+2][1]+=d[i][0]+d[i][2]; d[i+3][2]+=d[i][0]+d[i][1]; } wt(z=d[n][0..2]);}