#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>
#include <ctime>
#include <cstdlib>

using namespace std;

inline int to_int(string s) {int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string to_str(T x) {ostringstream sout; sout << x; return sout.str();}

typedef long long ll;

int main()
{
	//tall:高さ wide:幅 diag:対角線
	int tall, wide, diag;
	//rect:長方形 loze:菱形
	int rect = 0, loze = 0;
	while(scanf("%d,%d,%d",&tall, &wide, &diag) != EOF)
	{
		if(diag == sqrt(tall*tall + wide*wide))
		{
			rect++;
		}
		else if(tall == wide)
		{
			loze++;
		}
	}
	printf("%d\n%d\n",rect, loze);
}