// yukicoder My Practice // author: Leonardone @ NEETSDKASU #include typedef unsigned long ul; const ul MD = 1000000007UL; // 解説読後 // http://yukicoder.me/problems/882/editorial ul a, b = 1UL, c, ta; int main(void) { int n; scanf("%d", &n); while (--n) { ta = (b + c) % MD; c = b; b = a; a = ta; } printf("%lu\n", (((a + b) % MD) + c) % MD); return 0; }