#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <string>
#include <map>
#include <vector>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

int main(void)
{
    int a, b, c, rec = 0, rho = 0;
    
    while (~scanf("%d,%d,%d", &a, &b, &c)) {
        if (hypot(a, b) == c)
            rec++;
        else if (a == b)
            rho++;
    }
    
    cout << rec << endl << rho << endl;

    return 0;
}