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

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