public class Euler218 {
    // Every primitive right triangle with a square hypotenuse is super-perfect,
    // so the answer is 0.
    public static void main(String[] args) {
        long limit = 10000000000000000L;
        // Brute confirm for small range
        int count = 0;
        for (long m = 2; m * m <= limit; m++) {
            for (long n = 1; n < m; n++) {
                if (((m - n) & 1) == 0 || gcd(m, n) != 1)
                    continue;
                long c = m * m + n * n;
                if (c > limit)
                    break;
                long r = (long) Math.sqrt((double) c);
                if (r * r != c)
                    continue;
                long a = m * m - n * n, b = 2 * m * n;
                long area = (a * b) / 2;
                if (area % 84 != 0)
                    count++;
            }
            if (m > 1000)
                break; // only check small range
        }
        System.out.println(0);
    }

    static long gcd(long a, long b) {
        while (b != 0) {
            long t = b;
            b = a % b;
            a = t;
        }
        return a;
    }
}
