#include <iostream>
#include <vector>
#include <sstream>
#include <string>
#include <cmath>

using namespace std;

vector<string> split(const string &s, char delim) {
    vector<string> elems;
    string item;
    for (char ch: s) {
        if (ch == delim) {
            if (!item.empty())
                elems.push_back(item);
            item.clear();
        } else {
            item += ch;
        }
    }
    if (!item.empty())
        elems.push_back(item);
    return elems;
}

int main() {
    string buffer;
    int vedge, hedge, diagonal, countRect = 0, countRhom = 0;


    while (cin >> buffer) {
        vector<string> buffers = split(buffer, ',');
        
        vedge = stoi(buffers[0]);
        hedge = stoi(buffers[1]);
        diagonal = stoi(buffers[2]);
        
        if (vedge == hedge) {
            countRhom++;
        }
        if (pow(vedge, 2) + pow(hedge, 2) == pow(diagonal, 2)) {
            countRect++;
        }
    }

    cout << countRect << endl;
    cout << countRhom << endl;

    return 0;
}
