#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int a, b; //隣り合う辺の長さ
    int c;　　//対角線の長さ
    int rectangular = 0, rhombus = 0; //長方形と菱形の個数
    
    while(cin.fail()){
        cin >> a >> b >> c;
        if(a != b && a + b >= c && a * a + b * b == c * c) rectangular++;
        else if(a == b && a + b >= c) rhombus++;
    }
    cout << rectangular << endl;
    cout << rhombus << endl;
}

