#include #include using lint = long long; constexpr lint MOD = 1e9 + 7; void solve() { int n; std::cin >> n; if (n < 3) { std::cout << n << std::endl; return; } lint a = 0, b = 0, c = 1; while (n--) { lint d = (a + b) % MOD; a = b; b = c; c = d; } std::cout << (a + b + c) % MOD << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }