#include <iostream>
#include <string>
#include <math.h>
#include <stdio.h>
#include <ctype.h>

using namespace std;

int main () {
    int side[3];
    int rectangle=0;
    int lozenges=0;
    while(scanf("%d,%d,%d",&side[0],&side[1],&side[2])!=EOF){
        
        
        if(side[0]*side[0]+side[1]*side[1]==side[2]*side[2]){
            rectangle++;
        }else if(side[0]==side[1]){
            lozenges++;
        }
        
    }
    
    cout<<rectangle<<endl<<lozenges<<endl;
    return 0;
}