#include <cstdio>
#include <algorithm>
using namespace std;

int main(){
    int a, b, c, rec=0, rom = 0;
    while(scanf("%d,%d,%d", &a, &b, &c) != EOF) {
        if (a == 0) break;
        if (a*a+b*b == c*c) rec++;
        else if (a == b) rom++;
    }
    printf("%d\n%d\n", rec, rom);
    return 0;
}

