#include <iostream> #include <algorithm> #include <string.h> using namespace std; int dp[32768]; int main() { int N; int a[] = { 1,2,3 }; while (cin >> N) { memset(dp, 0, sizeof(dp)); for (int i = 0; i <= N; i++) dp[i] = 1; for (int i = 1; i <= 2; i++) { for (int j = a[i]; j <= N; j++) { dp[j] += dp[j - a[i]]; } } cout << dp[N] << endl; } return 0; }