#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;

int main() {
	string s;
	int cnt1 = 0, cnt2 = 0;
	while (cin >> s) {
		int a = (int)s[0] - 48, b = (int)s[2] - 48, c = (int)s[4] - 48;
		if (a == b)cnt2++;
		if (a*a + b*b == c*c)cnt1++;
	}
	cout << cnt1 << endl << cnt2 << endl;
	return 0;
}