N = gets.to_i D = 10 ** 9 + 7 a, b, c = 1, 0, 0 (N-1).times do a, b, c = c % D, a % D, (a + b) % D end puts (a + b + c) % D