#include<iostream>
#include <math.h>

using namespace std;

int main(void){
    double h1 ,h2 ,x;
    int rectangle= 0 ,rhombus= 0;
    char dummy;
    
    while ( cin>>h1>>dummy>>h2>>dummy>>x )
    {
        if (h1==h2) rhombus++;
        if (hypot(h1, h2)==x) rectangle++;
    }
    
    cout<<rectangle<<endl<<rhombus<<endl;
    
    return 0;
}