Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	var rectangle, diamond int
	for sc.Scan() {
		l := strings.Split(sc.Text(), ",")
		a, _ := strconv.Atoi(l[0])
		b, _ := strconv.Atoi(l[1])
		c, _ := strconv.Atoi(l[2])

		if a*a+b*b == c*c {
			rectangle++
		}
		if a == b {
			diamond++
		}
	}
	fmt.Println(rectangle)
	fmt.Println(diamond)
}

C++: #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;
}

C++: #include<bits/stdc++.h>
using namespace std;
int a,b,c,cnt1=0,cnt2=0;
char ch;
signed main(void){
	ios::sync_with_stdio(false);
	while(cin>>a>>ch>>b>>ch>>c){
		if(a==b)
			cnt2++;
		if(a*a+b*b==c*c)
			cnt1++;	
	}
	cout<<cnt1<<endl
		<<cnt2<<endl;
}

C++: #include <iostream>

using namespace std;

bool Rectangle(int a, int b, int c)
{
	return a * a + b * b == c * c;
}

bool Diamond(int a, int b, int c)
{
	return a == b;
}

int main()
{
	int a, b, c, sum1 = 0, sum2 = 0; char ch;

	while (cin >> a >> ch >> b >> ch >> c)
	{
		if (Rectangle(a, b, c)) sum1++;

		if (Diamond(a, b, c)) sum2++;
	}

	cout << sum1 << endl << sum2 << endl;

	return 0;
}

C++: #include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;
void getValue(string& line, int& a, int& b, int& c){
	string::size_type p1 = line.find(',');
	string::size_type p2 = line.rfind(',');
	a = atoi(line.substr(0, p1).c_str());
	b = atoi(line.substr(p1 + 1, p2 - p1 - 1).c_str());
	c = atoi(line.substr(p2 + 1).c_str());
}
int main()
{
	int a, b, c, n1, n2;
	n1 = n2 = 0;
	string s;
	while (cin >> s){
		getValue(s, a, b, c);
		if (c*c == a*a + b*b)
			++n1;
		else if (a == b)
			++n2;
	}
	cout << n1 << "\n" << n2 << "\n";
	return 0;
}

C++: #include<stdio.h>

int main(){
	int a,b,c;
	int d=0,e=0;
	while(~scanf("%d,%d,%d",&a,&b,&c)){
		if(a*a+b*b==c*c)d++;
		if(a==b)e++;
	}
	printf("%d\n%d\n",d,e);
}

C++: #include<stdio.h>
int main(){
	int a,b,c;
	int r=0,l=0;
	while(~scanf("%d,%d,%d",&a,&b,&c)){
		if(a*a+b*b==c*c)r++;
		if(a==b)l++;}
	printf("%d\n%d\n",r,l);
	return 0;}

C++: #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;
}

C++: #include<iostream>
using namespace std;

int main(){
	int edge1, edge2, diag, courec = 0, couloz = 0;
	while(scanf("%d,%d,%d", &edge1, &edge2, &diag) != EOF){
		if(edge1 == EOF || edge2 == EOF || diag == EOF) break;
		int edge11 = edge1 * edge1, edge22 = edge2 * edge2, diagg = diag * diag;
		if(edge1 != edge2 && edge11 + edge22 == diagg) courec++;
		else if(edge1 == edge2) couloz++;
	}
	cout <<courec <<endl <<couloz <<endl;
	return 0;
}

C++: #include<stdio.h>
#include<algorithm>

using namespace std;
int main()
 {
     int a[4];
     char ch;
     int r=0,l=0;
     while(scanf("%d%c%d%c%d",&a[0],&ch,&a[1],&ch,&a[2])!=EOF)
      {

          if((a[0]*a[0])+(a[1]*a[1])==(a[2]*a[2]))
           r++;
          else if(a[0]==a[1]||a[1]==a[2])
           l++;
      }
      printf("%d\n%d\n",r,l);
      return 0;
 }

C++: #include <stdio.h>

int main(void)
{
	int alpha=1;
	int beta=0; /*Óa,Ób,Îpüc*/
	int charley=0;
	int rect = 0;/*·û`Ì*/
	int rhom = 0;/*Ðµ`Ì*/


	while(alpha != 0){
	scanf("%d",&alpha);
	scanf(",%d",&beta);
	scanf(",%d",&charley);

	if( charley*charley == alpha*alpha + beta*beta && alpha != 0 )
		rect++;

	if( alpha == beta && alpha != 0 )
		rhom++;

	}


	printf("%d\n",rect);
	printf("%d\n",rhom);

	return 0;
}

C++: #include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <math.h>
#define p(n) pow(n,2)
using namespace std;
int main(){
  int a,b,c,rhom=0,rect=0;
  while(scanf("%d,%d,%d",&a,&b,&c)){
    if(p(a)+p(b)==p(c))rect++;
       if(a==b)rhom++;
  }
cout<<rect<<endl<<rhom<<endl;
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
using namespace std;

int main()
{
	int t=0, h=0;
	set<vector<int> > T, H;
	int a, b, c;
	string buf;
	while(cin>>buf){
		sscanf(buf.c_str(),"%d,%d,%d", &a, &b, &c);
		cout<<a<<b<<c;
		vector<int> all;
		all.push_back(a);
		all.push_back(b);
		all.push_back(c);
		sort(all.begin(), all.end());
		if(all[0]==all[1] || all[1]==all[2]);
		else if(all[1]==all[2]) H.insert(all);
		if(all[0]*all[0]+all[1]*all[1]==all[2]*all[2]) T.insert(all);
	}
	cout<<T.size()<<endl<<H.size()<<endl;
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int a,b,c;
int ansa,ansb;
int main() {
while(scanf("%d,%d,%d",&a,&b,&c)!=EOF){
	if((a==b)&&(b==c)&&(a==c)){

	}else if(pow(c,2)==(pow(a,2)+pow(b,2))){
		ansa++;
	}else{
		ansb++;
	}
}
cout<<ansa<<endl;
cout<<ansb<<endl;

}

C++: #include<iostream>
using namespace std;
int main() {
	int a, b, d;
	char c;
	int r, h;
	r = 0; h = 0;
	while (cin >> a >> c >> b >> c >> d){
		if (a == b){
			h += 1;
		}
		else if (a*a + b*b == c*c){
			r += 1;
		}
	}
	cout << r << endl << h << endl;
}

C++: #include <iostream>
#include <cstdio>
using namespace std;

int main(void)
{
	int a,b;
	int t;

	int countt=0;
	int counth=0;

	char input[100];

	while(!cin.eof())
	{
		cin >> input;
		a = input[0] - '0';
		b = input[2] - '0';
		t = input[4] - '0';
		if(a*a+b*b == t*t)//直角を持つ
		{
			if(a == b)
				++counth;
			else
				++countt;
		}
		else
			if(a == b)
				++counth;
	}
	cout << countt << endl;
	cout << counth << endl;
	//system("pause");
	return 0;
}

C++: 
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <vector>
#include <map>
#include <utility>
#include <complex>
#include <stack>
#include <climits>
#include <set>

using namespace std;

double sq(double x){return x*x;}

int main(){
	int a,b,c;
	int s = 0,t = 0;
	while(~scanf("%d,%d,%d",&a,&b,&c)){
		if(a * a + b * b == c * c)
			s++;
		else if( a == b)
			t++;
	}

	printf("%d\n%d\n",s,t);


	return 0;
}

C++: #include <iostream>
using namespace std;

int main(){
  int x, y, z;
  char komma;
  int hishi, choho;

  hishi=0; choho=0;
  while(cin>>x>>komma>>y>>komma>>z){
    if(x==y && x+y>z) hishi++;
    else if(x*x+y*y==z*z) choho++;
  }
  printf("%d\n%d\n", choho, hishi);

  return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <cassert>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>
#include <cstring>
#include <stack>
#include <queue>
#include <map>
#include <bitset>
#include <sstream>
#include <istream>
#include <cmath>
#include <cstdio>

using namespace std;

#define vci vector<int>
#define vcs vector<string>
#define pb push_back
#define sz size()
#define mapii map<int, int>
#define mapci map<char, int>
#define mapsi map<string, int>
#define all(x) x.begin(), x.end()
#define minit(a, i) memset(a, i, sizeof(a));

#define for_(i, a, b) for (int i=(int)a; i<(int)b; i++)
#define for_d(i, a, b) for (int i=(int)a-1; i>=b; i--)
#define for_r(i, a, b, c) for (int i=(int)a; i<(int)b; i += c)
#define for_dr(i, a, b, c) for (int i=(int)a-1; i>=b; i -= c)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

typedef long long ll;

const int iINF = 2147483647;
const ll lINF = 9223372036854775807;

template <class T> inline void dbg(T t) { cout << t << endl; }





int main() {
	int l, r, c; char o;
	int rec = 0, par = 0;
	
	while (cin>>l>>o>>r>>o>>c) {
		if (l*l+r*r==c*c) rec++;
		else if (l==r) par++;
	}
	
	cout << rec << endl << par << endl;
	
	return 0;
}