#include <bits/stdc++.h>
using namespace std;
int main(void){
    int a,b,c,counta,countb;
    counta = 0;
    countb = 0;
    while (scanf("%d,%d,%d", &a,&b,&c)!=EOF) {
        if (a*a+b*b==c*c) {
            counta++;
        } else if (a==b) {
            countb++;
        }
    }
    cout << counta << endl;
    cout << countb << endl;
}

