#include <iostream>

using namespace std;

int main()
{
    int x, y, d;
    int rect, lozen;
    char comma;

    rect = lozen = 0;
    while (cin >> x >> comma >> y >> comma >> d) {
        if (x * x + y * y == d * d)
            rect++;
        else if (x == y)
            lozen++;
    }
    cout << rect << '\n' << lozen << endl;

    return 0;
}