n = gets.to_i
t = n/3 #１からtまで
if n==1 || n ==2
  puts 0
  exit
elsif n==3 || n==4
  puts 1
  exit
end
def f(n,k)
  if k==1
    return 1
  else
    return f(n-1,k)+f(n-3,k-1)
  end
end
sum = 0
for k in 1..t
  sum += f(n,k)
end
puts sum%(10**9+7)