#include int pr[300001]; int prs[26000]; int ptr; long long dp[4][300000]; int main(void) { int n; scanf("%d", &n); for (int i = 2; i <= 300000; i++) { if (!pr[i]) { prs[ptr++] = i; for (int j = i * 2; j <= 300000; j += i) { pr[j] = 1; } } pr[i] = !pr[i]; } dp[0][0] = 1; for (int k = 0; prs[k] <= n; k++) { for (int i = 2; i >= 0; i--) { for (int j = 0; j <= 100000 * i; j++) { if (dp[i][j] == 0) continue; dp[i + 1][prs[k] + j] += dp[i][j]; } } } long long ans = 0; for (int i = 0; i < 300000; i++) { if (pr[i]) { ans += dp[3][i]; } } printf("%lld\n", ans); return 0; }