import java.util.*;
import java.lang.*;
import java.io.*;
class Main
{
{
Scanner in
= new Scanner
(System.
in); long x1, x2, x3, 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
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CiAKY2xhc3MgTWFpbgp7CiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24KICAgIHsKICAgICAgICBTY2FubmVyIGluID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKICAgICAgICBsb25nIHgxLCB4MiwgeDMsIHg0ID0gMDsKICAgICAgICBsb25nIG4gPSBpbi5uZXh0TG9uZygpOwogICAgICAgIHgxID0gMjsKICAgICAgICB4MiA9IDQ7CiAgICAgICAgeDMgPSA3OwogICAgICAgIGZvciAoaW50IGkgPSAzOyBpIDwgbjsgaSsrKSB7CiAgICAgICAgICAgIHg0ID0geDEgKyB4MiArIHgzOwogICAgICAgICAgICB4MSA9IHgyOwogICAgICAgICAgICB4MiA9IHgzOwogICAgICAgICAgICB4MyA9IHg0OyAgICAKICAgICAgICB9CiAgICAgICAgaWYgKG4gPT0gMSkgCiAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigyKTsgCiAgICAgICAgZWxzZSBpZiAobiA9PSAyKSAKICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKDQpOyAKICAgICAgICBlbHNlIGlmIChuID09IDMpCiAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbig3KTsgCiAgICAgICAgZWxzZSAKICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKHg0KTsKICAgIH0KfQ==