#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
using namespace std;

int main(){
	int a,b,c;
	char s,t;
	int rectangle = 0,diamond = 0;
	while(cin >> a >> s >> b >> t >> c){
		if(a*a + b*b == c*c)rectangle++;
		if(a == b)diamond++;
	}
	cout << rectangle << endl << diamond << endl;
}
