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