#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int F[51] = {0, 1, 1, 2, 3};
for(int i = 5; i <= n; i++) {
F[i] = F[i-2] + F[i-3] + F[i-4];
}
cout << F[n];
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCmludCBtYWluKCkgewogICBpbnQgbjsKICAgY2luID4+IG47CiAgIGludCBGWzUxXSA9IHswLCAxLCAxLCAyLCAzfTsKICAgZm9yKGludCBpID0gNTsgaSA8PSBuOyBpKyspIHsKICAgICAgRltpXSA9IEZbaS0yXSArIEZbaS0zXSArIEZbaS00XTsKICAgfQogICBjb3V0IDw8IEZbbl07CiAgIHJldHVybiAwOwp9Cgo=