#include<bits/stdc++.h>
using namespace std;
int main(void){
	int a,b,c;
	int tsum,hsum;
	tsum=hsum=0;
	while(scanf("%d,%d,%d",&a,&b,&c)!=EOF){
		if(a==b)	hsum++;
		else{
			if(a<b&&b<c||a>b&&a<c)	tsum++;
		}
	}
	cout<<tsum<<endl;
	cout<<hsum<<endl;
	return 0;
}
