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