import scala.annotation.tailrec import scala.io.StdIn object Main extends App { val mod: Int = Math.pow(10, 9).toInt + 7 def proc(n: Int): Int = { if (n == 1) return 1 @tailrec def rec(cnt: Int, a: Long, b: Long, c: Long): Long = { if (cnt <= 2) { (a + b + c) % mod } else { rec(cnt - 1, c, (a + c) % mod, b) } } rec(n, 1, 1, 0).toInt } val n = StdIn.readInt() val result = proc(n) println(result) }