import java.nio.file.*;
import java.util.*;

public class Euler102 {
    public static void main(String[] args) throws Exception {
        List<String> lines = Files.readAllLines(Path.of("resources/documents/0102_triangles.txt"));
        int count = 0;
        for (String line : lines) {
            String[] p = line.trim().split(",");
            if (p.length < 6)
                continue;
            int x1 = Integer.parseInt(p[0]), y1 = Integer.parseInt(p[1]), x2 = Integer.parseInt(p[2]),
                    y2 = Integer.parseInt(p[3]), x3 = Integer.parseInt(p[4]), y3 = Integer.parseInt(p[5]);
            long c1 = (long) x1 * y2 - (long) y1 * x2, c2 = (long) x2 * y3 - (long) y2 * x3,
                    c3 = (long) x3 * y1 - (long) y3 * x1;
            boolean neg = c1 < 0 || c2 < 0 || c3 < 0, pos = c1 > 0 || c2 > 0 || c3 > 0;
            if (!(neg && pos))
                count++;
        }
        System.out.println(count);
    }
}
