#include #include #include using namespace std; typedef long long LL; int main(void) { std::ios::sync_with_stdio(false); std::cin.tie(0); int N; cin >> N; LL** dp; dp = (LL**)calloc(N+1, sizeof(LL)); for (int i = 0; i < N+1; i++) { dp[i] = (LL*)calloc(N+1, sizeof(LL)); } dp[0][0] = 1; for (int i = 0; i < N+1; i++) { for (int j = 0; j < N+1; j++) { if (i * 2 + j > N) { break; } if ((i > 0) && (j > 0)) { dp[i][j] = dp[i - 1][j] + dp[i][j - 1]; } else if (i > 0) { dp[i][j] = dp[i - 1][j]; } else if (j > 0) { dp[i][j] = dp[i][j - 1]; } } } LL count = 0; int piv = N; for (int i = 0; i < N + 1; i++) { if (piv < 0) { break; } count += dp[i][piv]; piv -= 2; } cout << count << endl; }