// yukicoder My Practice // author: Leonardone @ NEETSDKASU // 解説読後 // http://yukicoder.me/problems/882/editorial import std.stdio; void main() { uint n, a = 0, b = 1, c = 0, ta, r; readf("%d", &n); while (--n) { ta = (b + c) % 1000000007; c = b; b = a; a = ta; } r = (a + b + c) % 1000000007UL; writeln(r); }