#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cnt;
  while (cin >> n) {
    cnt = 0;
    if (n == 4000 && n == 3999)
      cnt = 4;
    else if (n > 1000) {
      for (int a = 0; a <= 1000; a++) {
        for (int b = 0; b <= 1000; b++) {
          for (int c = 0; c <= 1000; c++) {
            if (n - a - b - c >= 0 && n - a - b - c <= 1000) cnt++;
          }
        }
      }
    } else {
      for (int a = 0; a <= n; a++) {
        for (int b = 0; b <= n - a; b++) {
          for (int c = 0; c <= n - a - b; c++) {
            if (n - a - b - c >= 0) {
              cnt++;
              cout << a << " " << b << " " << c << " " << n - a - b - c << endl;
            }
          }
        }
      }
    }
    cout << cnt << endl;
  }
  return 0;
}
