#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

int main()
{
//	cut here before submit 
//	freopen ("testcase.PB", "r", stdin );
	string str = "";
	int rectangle = 0, lozenge = 0;
	while (getline (cin, str ) ){
		int n = str.length();
		rep (i, n ){
			if (str[i] == ',' ) str[i] = ' ';
		} // end rep
		stringstream ss (str );
		int side1, side2, diagonal;
		ss >> side1 >> side2 >> diagonal;
		if (side1 == side2 || side1*side1 + side2*side2 == diagonal*diagonal ){
			if (side1 == side2 && side1*side1 + side2*side2 == diagonal*diagonal ){
				++rectangle; ++lozenge;
			}else
			if (side1 != side2 && side1*side1 + side2*side2 == diagonal*diagonal ){
				++rectangle;
			}else
			if (side1 == side2 && side1*side1 + side2*side2 != diagonal*diagonal ){
				++lozenge;
			} // end if
		} // end if
	} // end loop
	cout << rectangle << endl;
	cout << lozenge << endl;

//	printf ("%d\n", res );
		
	return 0;
}