import java.util.*;
import java.lang.*;
import java.io.*;
class Ideone
{
{
Scanner in
= new Scanner
(System.
in); long x1,x2,x3;
long x4=0;
long n=in.nextLong();
x1=2;
x2=4;
x3=7;
for (int i=3; i<n; i++) {
x4=x1+x2+x3;
x1=x2;
x2=x3;
x3=x4;
}
if (n==1)
else if (n==2)
else if (n==3)
else
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBJZGVvbmUKewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgkJU2Nhbm5lciBpbiA9IG5ldyBTY2FubmVyKFN5c3RlbS5pbik7CgkJbG9uZyB4MSx4Mix4MzsKCQlsb25nIHg0PTA7CgkJbG9uZyBuPWluLm5leHRMb25nKCk7CgkJeDE9MjsKCQl4Mj00OwoJCXgzPTc7CgkJZm9yIChpbnQgaT0zOyBpPG47IGkrKykgewoJCQl4ND14MSt4Mit4MzsKCQkJeDE9eDI7CgkJCXgyPXgzOwoJCQl4Mz14NDsgICAgCgkJfQoJCWlmIChuPT0xKSAKCQkJU3lzdGVtLm91dC5wcmludGxuKDIpOyAKCQllbHNlIGlmIChuPT0yKSAKCQkJU3lzdGVtLm91dC5wcmludGxuKDQpOyAKCQllbHNlIGlmIChuPT0zKQoJCQlTeXN0ZW0ub3V0LnByaW50bG4oNyk7IAoJCWVsc2UgCgkJCVN5c3RlbS5vdXQucHJpbnRsbih4NCk7Cgl9Cn0=