import java.util.*;

public class Euler184 {
    public static void main(String[] args) {
        int R = 105;
        double PI = Math.PI, EPS = 1e-8;
        List<Double> angles = new ArrayList<>();
        for (int x = -R; x <= R; x++)
            for (int y = -R; y <= R; y++) {
                if ((x == 0 && y == 0) || x * x + y * y >= R * R)
                    continue;
                angles.add(Math.atan2(y, x));
            }
        Collections.sort(angles);
        int n = angles.size();
        int half = n / 2;
        long ans = (long) n * (n - 1) * (n - 2) / 6;
        int i = 0;
        while (i < half) {
            long cnt = 1;
            while (i + cnt < half && angles.get((int) (i + cnt)) - angles.get(i) <= EPS)
                cnt++;
            ans -= (half - cnt) * (half - cnt - 1) * cnt;
            ans -= cnt * cnt * (n - 2 * cnt) + cnt * (cnt - 1) * (half - cnt);
            long d = 2 * cnt;
            ans -= d * (d - 1) * (d - 2) / 6;
            i += (int) cnt;
        }
        System.out.println(ans);
    }
}
