n=gets.to_i;memo=[1,0];M=1000000007;for i in 2..n;memo[i]=(memo[i-2]+memo[i-3])%M;end;p (memo[n]+memo[n-1]+memo[n-2])%M