#include <iostream>
#include <cstdio>

using namespace std;

int main(void){
  int d1,d2,d3;
  int count1=0,count2=0;

  while(scanf("%d,%d,%d",&d1,&d2,&d3)!=EOF){
    if(d1*d1+d2*d2==d3*d3&&d1!=d2)count1++;
    if(d1*d1+d2*d2!=d3*d3&&d1==d2)count2++;
  }

  cout<<count1<<endl;
  cout<<count2<<endl;

  return(0);
}