#include <iostream>
using namespace std;
int F[51] = {0, 1, 1, 2, 3};
int numberOfWays(int n) {
if(F[n]) {
return F[n];
} else {
F[n] = numberOfWays(n-2) + numberOfWays(n-3) + numberOfWays(n-4);
}
return F[n];
}
int main() {
int n;
cin >> n;
cout << numberOfWays(n);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCmludCBGWzUxXSA9IHswLCAxLCAxLCAyLCAzfTsKIAppbnQgbnVtYmVyT2ZXYXlzKGludCBuKSB7CiAgIGlmKEZbbl0pIHsKICAgICAgcmV0dXJuIEZbbl07CiAgIH0gZWxzZSB7CiAgICAgIEZbbl0gPSBudW1iZXJPZldheXMobi0yKSArIG51bWJlck9mV2F5cyhuLTMpICsgbnVtYmVyT2ZXYXlzKG4tNCk7CiAgIH0KICAgcmV0dXJuIEZbbl07Cn0KCmludCBtYWluKCkgewogICBpbnQgbjsKICAgY2luID4+IG47CiAgIGNvdXQgPDwgbnVtYmVyT2ZXYXlzKG4pOwogICByZXR1cm4gMDsKfQ==