n=gets.to_i if n==1 puts 1 exit elsif n==2 puts 1 exit elsif n==3 puts 3 exit end m=10**9+7 a=Hash.new(0) b=Hash.new(0) c=Hash.new(0) a[1]=1 b[2]=1 c[3]=1 ans=0 loop{ x=Hash.new(0) y=Hash.new(0) z=Hash.new(0) a.each{|k,v| if k+2 < n y[k+2]=(y[k+2]+v)%m elsif k+2==n ans=(ans+v)%m end if k+3 < n z[k+3]=(z[k+3]+v)%m elsif k+3==n ans=(ans+v)%m end } b.each{|k,v| if k+1 < n x[k+1]=(x[k+1]+v)%m elsif k+1==n ans=(ans+v)%m end if k+3 < n z[k+3]=(z[k+3]+v)%m elsif k+3==n ans=(ans+v)%m end } c.each{|k,v| if k+1 < n x[k+1]=(x[k+1]+v)%m elsif k+1==n ans=(ans+v)%m end if k+2 < n y[k+2]=(y[k+2]+v)%m elsif k+2==n ans=(ans+v)%m end } a,b,c=x,y,z break if a.empty? && b.empty? && c.empty? } puts ans