#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <string>

#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(x=from;x<to;x++)

using namespace std;


int main(void){

char g;
int a,b,c;
int tcnt=0,hcnt=0;

	while(cin >> a >> g >> b >> g >> c){
		if(a*a+b*b == c*c ) tcnt++;
		if(a==b ) hcnt++;
	}
	cout << tcnt <<endl << hcnt << endl;
	return 0;
	
	
}