#include <iostream>
#include <string>
using namespace std;

int main(){
  int a,b,c,h=0,t=0;
  string s;
  while(cin>>s){
    a=s[0]-'0';
    b=s[2]-'0';
    c=s[4]-'0';
    if(a==b)h++;
    else if(a*a+b*b==c*c)t++;
  }
  cout<<t<<endl<<h<<endl;
  return 0;
}