#include <iostream>
using namespace std;
int main() {
    int a, b, c;
    int c1 = 0, c2 = 0;
    char d;
    while (cin >> a >> d >> b >> d >> c) {
        if (a * a + b * b == c * c) {
            c1 ++;
        }
        if (a == b) {
            c2 ++;
        }
    }
    cout << c1 << "\n";
    cout << c2 << "\n";
    return 0;
}