import java.util.*;

public class Euler224 {
    static class Triple {
        long a, b, c;

        Triple(long a, long b, long c) {
            this.a = a;
            this.b = b;
            this.c = c;
        }
    }

    public static String solve() {
        long perimeterLimit = 75000000;

        long[][] m1 = {
                { 1, -2, 2 },
                { 2, -1, 2 },
                { 2, -2, 3 }
        };
        long[][] m2 = {
                { 1, 2, 2 },
                { 2, 1, 2 },
                { 2, 2, 3 }
        };
        long[][] m3 = {
                { -1, 2, 2 },
                { -2, 1, 2 },
                { -2, 2, 3 }
        };

        long[][][] matrices = { m1, m2, m3 };

        long count = 0;

        // Custom stack for performance
        long[] stackA = new long[1000000];
        long[] stackB = new long[1000000];
        long[] stackC = new long[1000000];
        int top = 0;

        stackA[0] = 2;
        stackB[0] = 2;
        stackC[0] = 3;
        top++;

        while (top > 0) {
            top--;
            long a = stackA[top];
            long b = stackB[top];
            long c = stackC[top];

            if (a + b + c > perimeterLimit) {
                continue;
            }

            if (a <= b && a + b > c) {
                count++;
            }

            for (int i = 0; i < 3; i++) {
                long[][] m = matrices[i];
                long childA = m[0][0] * a + m[0][1] * b + m[0][2] * c;
                long childB = m[1][0] * a + m[1][1] * b + m[1][2] * c;
                long childC = m[2][0] * a + m[2][1] * b + m[2][2] * c;

                if (childA <= 0 || childB <= 0 || childC <= 0)
                    continue;
                if (childA + childB + childC <= perimeterLimit) {
                    if (top >= stackA.length) {
                        stackA = Arrays.copyOf(stackA, stackA.length * 2);
                        stackB = Arrays.copyOf(stackB, stackB.length * 2);
                        stackC = Arrays.copyOf(stackC, stackC.length * 2);
                    }
                    stackA[top] = childA;
                    stackB[top] = childB;
                    stackC[top] = childC;
                    top++;
                }
            }
        }

        return String.valueOf(count);
    }

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