#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <string>
#include <stack>
#include <iomanip>
#include <numeric>
#include <queue>
#include <climits>
#include <complex>
#include <cmath>
#include <map>
using namespace std;
using ll = long long;
#define MOD 1000000007
#define INF 1LL << 59

int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    //cout << fixed << setprecision(3);

    int arr[3];
    int r = 0, t = 0;
    char c;
    while (cin >> arr[0] >> c >> arr[1] >> c >> arr[2])
    {
        if (arr[0] == arr[1])
            t++;
        if (arr[0] * arr[0] + arr[1] * arr[1] == arr[2] * arr[2])
            r++;
    }

    cout << r << "\n"
         << t << endl;
    return 0;
}
