#include <iostream>
#include <vector>
#include <map>
#include <stack>
#include <list>
#include <queue>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <math.h>

using namespace std;

int Pythagoras(int a, int b = 0){
	return a * a + b * b;
}

int main(){
	int edge1 = 0, edge2 = 0, diagonal = 0;
	int diamond = 0, rect = 0;
	
	while(scanf("%d,%d,%d",&edge1, &edge2, &diagonal) != EOF){
		if(edge1 == edge2){
			diamond++;
		}
		else if(Pythagoras(edge1, edge2) ==  Pythagoras(diagonal)){
			rect++;
		}
	}

	cout << rect << endl << diamond << endl;
	return 0;
}