#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int a,b,c;
  int cnt1=0,cnt2=0;
  while(scanf("%d,%d,%d",&a,&b,&c)!=EOF){
    if((a*a+b*b)==c*c) cnt1++;
    if(a==b) cnt2++;
  }
  cout << cnt1<<endl;
  cout << cnt2<<endl;
  return 0;
}