#include <iostream>
#include <string>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <set>
using namespace std;

int main(){
	vector<int> num(3);
	set<string> rectangle, lozenge;
	while( ~scanf("%d,%d,%d", &num[0], &num[1], &num[2]) ){
		sort(num.begin(), num.end());
		string temp = "";
		for(int i=0; i<3; i++) temp += '0'+num[i];
		if( temp[0] == temp[1] ) lozenge.insert(temp);
		else rectangle.insert(temp);
	}
	cout << rectangle.size() << endl;
	cout << lozenge.size() << endl;
}