mod=1000000007

s=gets.to_i
arr=[]

arr<<[s] if s>=3

if (s/2.floor >= 3)
  a=3
  3.upto(s) do
    if ((s-a) >= 3)
      b = s-a
      arr<<[a,b]
      a+=1
    end
  end
end

if(s/3.floor >= 3)
  a=3
  3.upto(s-3) do
    if(s-a-3 >= 3)
      b=3
      3.upto(s-6)do
        if (s-(a+b) >= 3)
          c = s-(a+b)
          arr<<[a,b,c]
          b+=1
        end
      end
    end
    a+=1
  end
end

p arr.length % mod
