#include<iostream>
using namespace std;
int main(){
	int a, b, c, rect, = 0, rhom = 0;
	while(cin >> a >> b >> c){
		if( a * a + b * b == c * c ) rect++;
		else if( a == b ) rhom++;
	}
	cout << rect << "?\n" << rhom << endl;
}