#include <stdio.h>
#include <math.h>
#include <string.h>
int main()
{
int T;scanf("%d",&T);
int count_a=0,count_b=0;
while(T--){
int a,_a,b,_b;
scanf("%d%d%d%d",&a,&_a,&b,&_b);
if(a+b==_a&&a+b!=_b) count_b++;
else if(a+b==_b&&a+b!=_a) count_a++;
}
printf("%d %d\n",count_a,count_b);
return 0;
}