#include<stdio.h>

int main(void)
{
        int hen1 = 0, hen2 = 0, x = 0;
        int ccount = 0 , hcount = 0;

        while(scanf("%d,%d,%d",&hen1, &hen2, &x) != EOF)
        {
                if(x >= hen1 && x >= hen2)
                {


                        else if(hen1 == hen2)
                        {
                                hcount++;
                        }
                        else
                        {
                                ccount++;
                        }
                }
        }
        printf("%d\n",ccount);
        printf("%d\n",hcount);
        return 0;
}