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

int main()
{
	int t=0, h=0;
	set<vector<int> > T, H;
	int a, b, c;
	string buf;
	while(cin>>buf){
		if(buf=="0") break;
		sscanf(buf.c_str(),"%d,%d,%d", &a, &b, &c);
		vector<int> all;
		all.push_back(a);
		all.push_back(b);
		all.push_back(c);
		sort(all.begin(), all.end());
		if(all[0]==all[1] || all[1]==all[2]); H.insert(all)
		if(all[0]*all[0]+all[1]*all[1]==all[2]*all[2]) T.insert(all);
	}
	cout<<T.size()<<endl<<H.size()<<endl;
	return 0;
}