#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <cmath>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define For(i,a,b) for(int (i)=(a); (i)<(b); (i)++)

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