object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val s = sc.nextInt()

  val mod = 1000000007
  def plus(a: Long, b: Long): Long = (a + b) % mod

  if (s < 3) {
    println(0)
  } else {
    val dp = Array.fill(s+1)(0L)
    val dpSum = Array.fill(s+2)(0L)
    dp(0) = 1
    dpSum(0) = 1

    for (i <- 1 until 3) {
      dp(i) = 0
      dpSum(i) = plus(dpSum(i-1), dp(i))
    }

    for (i <- 3 to s) {
      dp(i) = dpSum(i-3)
      dpSum(i) = plus(dpSum(i-1), dp(i))
    }

    println(dp(s))
  }
}
