// The "Problem2" class.
import java.io.*;
public class Problem2
{
    public static void main (String[] args) throws IOException
    {
	BufferedReader input = new BufferedReader (new FileReader ("DATA2.txt"));
	String temp, temp2;
	String[] tempnum = new String [50], tempnum1 = new String [50];
	int[] num = new int [2];
	int num2, counter = 0;


	for (int i = 0 ; i < 50 ; i++)
	{

	    tempnum [i] = input.readLine ();
	}
	for (int i = 0 ; i < 5 ; i++)
	{

	    for (int j = 0 ; j < 2 ; j++)
	    {
		tempnum1 = tempnum [i].split (" +");
		num [j] = Integer.parseInt (tempnum1 [j]);
	    }
	    num2 = Integer.parseInt (tempnum [i + 5]);
	    if (num [0] + num [1] == num2)
	    {
		counter++;
	    }


	}
	System.out.println (counter);
	counter = 0;
	for (int i = 10 ; i < 15 ; i++)
	{

	    for (int j = 0 ; j < 2 ; j++)
	    {
		tempnum1 = tempnum [i].split (" +");
		num [j] = Integer.parseInt (tempnum1 [j]);
	    }
	    num2 = Integer.parseInt (tempnum [i + 5]);
	    if (num [0] + num [1] == num2)
	    {
		counter++;
	    }


	}
	System.out.println (counter);
	counter = 0;
	for (int i = 20 ; i < 25 ; i++)
	{

	    for (int j = 0 ; j < 2 ; j++)
	    {
		tempnum1 = tempnum [i].split (" +");
		num [j] = Integer.parseInt (tempnum1 [j]);
	    }
	    num2 = Integer.parseInt (tempnum [i + 5]);
	    if (num [0] + num [1] == num2)
	    {
		counter++;
	    }


	}
	System.out.println (counter);
	counter = 0;
	for (int i = 30 ; i < 35 ; i++)
	{

	    for (int j = 0 ; j < 2 ; j++)
	    {
		tempnum1 = tempnum [i].split (" +");
		num [j] = Integer.parseInt (tempnum1 [j]);
	    }
	    num2 = Integer.parseInt (tempnum [i + 5]);
	    if (num [0] + num [1] == num2)
	    {
		counter++;
	    }


	}
	System.out.println (counter);
	counter = 0;
	for (int i = 40 ; i < 45 ; i++)
	{

	    for (int j = 0 ; j < 2 ; j++)
	    {
		tempnum1 = tempnum [i].split (" +");
		num [j] = Integer.parseInt (tempnum1 [j]);
	    }
	    num2 = Integer.parseInt (tempnum [i + 5]);
	    if (num [0] + num [1] == num2)
	    {
		counter++;
	    }


	}
	System.out.println (counter);
	counter = 0;



    } // main method
} // Problem2 class



