import java.util.concurrent.atomic.AtomicInteger;

public class Euler620 {
    static double clamp(double x, double lo, double hi) {
        if (x < lo)
            return lo;
        if (x > hi)
            return hi;
        return x;
    }

    static long safeFloor(double x) {
        double EPS = 1e-13;
        double y = x + EPS;
        long f = (long) Math.floor(y);

        while (f + 1 <= y)
            f++;
        while (f > y)
            f--;
        return f;
    }

    static long gValue(int s, int p, int q, double PI, double TWO_PI) {
        int A = s + p;
        int B = s + q;

        double D = (double) p + (double) q - TWO_PI;

        double xBeta = clamp(((double) B * B + D * D - (double) A * A) / (2.0 * B * D), -1.0, 1.0);
        double xDelta = clamp(((double) A * A + D * D - (double) B * B) / (2.0 * A * D), -1.0, 1.0);

        double beta = Math.acos(xBeta);
        double delta = Math.acos(xDelta);

        double mMax = ((double) B * beta - (double) A * delta) / PI;
        long t = safeFloor(mMax);

        long g = A + t;
        return (g > 0) ? g : 0;
    }

    public static String solve() {
        int n = 500;
        int threads = Runtime.getRuntime().availableProcessors();
        if (threads <= 0)
            threads = 1;

        double PI = Math.PI;
        double TWO_PI = 2.0 * PI;

        AtomicInteger nextS = new AtomicInteger(5);
        long[] partial = new long[threads];
        Thread[] pool = new Thread[threads];

        for (int i = 0; i < threads; i++) {
            final int tid = i;
            pool[i] = new Thread(() -> {
                long local = 0;
                while (true) {
                    int s = nextS.getAndIncrement();
                    if (s > n)
                        break;

                    int m = n - s;
                    int maxP = (m - 1) / 2;
                    if (maxP < 5)
                        continue;

                    for (int p = 5; p <= maxP; p++) {
                        int maxQ = m - p;
                        for (int q = p + 1; q <= maxQ; q++) {
                            local += gValue(s, p, q, PI, TWO_PI);
                        }
                    }
                }
                partial[tid] = local;
            });
            pool[i].start();
        }

        for (int i = 0; i < threads; i++) {
            try {
                pool[i].join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

        long total = 0;
        for (long v : partial) {
            total += v;
        }

        return Long.toString(total);
    }

    public static void main(String[] args) {
        System.out.println(solve());
    }
}
