#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long LL; typedef double DB; typedef pair PII; typedef vector VI; #define X first #define Y second #define pb push_back template inline void chkmin(T &x, T y) { if (y < x) x = y; } template inline void chkmax(T &x, T y) { if (x < y) x = y; } int n; LL val[65]; int main() { // freopen("in.txt", "r", stdin); // freopen("out.txt", "w", stdout); int i, j, k; val[0] = 1; val[1] = 1; val[2] = 2; val[3] = 3; for (i = 4; i <= 60; i++) { val[i] = val[i - 1] + val[i - 3] + 1; } while (scanf("%d", &n) == 1) { cout << val[n] << endl; } return 0; }