Go: package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	d := 0
	e := 0
	for scanner.Scan() {
		info := strings.Split(scanner.Text(), ",")
		a, _ := strconv.Atoi(info[0])
		b, _ := strconv.Atoi(info[1])
		c, _ := strconv.Atoi(info[2])
		if a*a + b*b == c*c {
			d++
		}
		if a == b {
			e++
		}
	}
	fmt.Println(d)
	fmt.Println(e)
}

C++: #include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <math.h>
#include <functional>
#include <algorithm>
#include <utility>

typedef long long Int; 
#pragma warning(disable : 4996)
#define REP(i,n) for(int i = 0 ; i < n ; ++i)
#define REPS(a,i,n) for(int i = a ; i < n ; ++i)
using namespace std;




int main(){


	int a, b, c;
	int t(0), h(0);
	while (scanf("%d,%d,%d", &a, &b, &c) != EOF){
		if (a + b < c || a + c < b || b + c < a || !a || !b || !c)continue;


		if (a*a + b*b == c*c)
			++t;

		if (a == b)
			++h;

	cout << t << endl << h << endl;
	}

	return 0;
}

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

int main(void) {
    string s;
    int rect = 0, rhom = 0;
    while (cin >> s) {
        replace(s.begin(), s.end(), ',', ' ');
        stringstream ss(s);
        int x, y, z;
        ss >> x >> y >> z;

        if (x == y || y == z || z == x) rhom++;
        else if (x*x + y*y == z*z) rect++;
    }

    cout << rect << endl;
    cout << rhom << endl;

    return 0;
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>

typedef long long ll;
using namespace std;

typedef pair<int,int> P;

int main()
{
	string str;
	int rect_num=0;
	int diam_num=0;
	int edge1, edge2, diag;
	while(~scanf("%d,%d,%d",&edge1,&edge2,&diag)){

		if(edge1 + edge2 <= diag) continue;

		if(edge1*edge1 + edge2*edge2 == diag * diag){
			rect_num++;
		}
		else if(edge1 == edge2){
			diam_num++;
		}
	}

	printf("%d\n%d\n",rect_num,diam_num);
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main(){
  int a1,a2,a3,count1=0,count2=0,c,c2;
  char b1,b2;
  while(cin>>a1>>b1>>a2>>b2>>a3){
    c=2*(sqrt((a1*a1-a3*a3/4)));
    c=2*(sqrt(a3*a3+c*c));
    c2=(a1+a2)*2;
    if(a1*a1+a2*a2==a3*a3)
      count1++;
    else if(c2==c)
      count2++;
  }
  cout<<count1<<endl<<count2<<endl;
  return 0;
}

C++: #include <iostream>

using namespace std;

void solve()
{
	int rect = 0;
	int diamond = 0;
	int a, b, c;
	while(~scanf("%d,%d,%d", &a, &b, &c))
	{
		if(a == 0 || b == 0 || c == 0)
		{
			continue;
		}
		if(a != b)
		{
			if(a * a + b * b == c * c)
			{
				++rect;
			}
		}
		else
		{
			if(2 * a > c && 2 * c > a)
			{
				++diamond;
			}
		}
	}
	cout << rect << endl;
	cout << diamond << endl;
}

int main()
{
	solve();
	return(0);
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,ans1=0,ans2=0,n = 100;
  char x[3];
  while(cin >> a && a != EOF && n-- && n!=0){
    cin >> x[0] >> b >> x[1] >> c;
    if( a*a + b*b == c*c)ans1++;
    else if(a == b || a == c || b == c)ans2++;
  }
  cout << ans1 << endl << ans2 <<endl;
  return 0;
}

C++: #include<functional>
#include<algorithm>
#include<iostream>
#include<utility>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#define REP(i,n) for(int i=0;i<n;i++)
#define LOOP(i,x,n) for(int i=x;i<n;i++)
#define ALL(v) (v).begin(),(v).end()
#define pf push_front
#define pb push_back
#define int long long
using namespace std;
const int INF=1000000007;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

signed main(){
  int a,b,c;
  char k;
  int ans1=0,ans2=0;
  while(cin>>a>>k>>b>>k>>c){
    if((a*a+b*b)==c*c)ans1++;
    else if(a==b&&a!=c)ans2++;
  }
  cout<<ans1<<endl;
  cout<<ans2<<endl;
  
  return 0;
}

C++: #include <iostream>

using namespace std;

int main(int argc, char const* argv[])
{
	int e1,e2,e3;
	int hisi = 0;
	int tyou = 0;

	while( scanf("%d,%d,%d",&e1,&e2,&e3 ) ){
		if( e1 == e2 ) hisi++;
		else if( e1 * e1 + e2 * e2 == e3 * e3 ) tyou++;
	}

	cout << tyou << endl;
	cout << hisi << endl;

	return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main(){
	int tyou=0,hisi=0;
	char damy;
	int side[3];
	while(cin>>side[0]>>damy>>side[1]>>damy>>side[2]){
		if(side[0]==side[1]){
			++hisi;
			continue;
		}else if(pow((double)side[0],2)+pow((double)side[1],2)==pow((double)side[2],2))++tyou;
	}
	cout<<tyou<<endl<<hisi<<endl;
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

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++;
    }

    cout << d << "\n" << e << endl;
}

C++: #include <iostream>
using namespace std;
int main(void){
  int a,b,c,ans=0,ans2=0;
  char ch;
  while(cin>>a>>ch>>b>>ch>>c){
    if(a*a +b*b == c*c)
         ans = ans + 1;
    if(a == b)
    ans2 = ans2 + 1;
    }
    cout << ans << endl;
    cout << ans2 << endl;
    return 0;
  }

C++: #include<iostream>
using namespace std;
 
int main(){
  int n1,n2,n3;
  int T=0,S=0;
  char s;
  while(cin>>n1>>s>>n2>>s>>n3){
    if(n1==n2)T++;
    else if((n1*n1)+(n2*n2)==(n3*n3))S++;
  }
  cout<<S<<endl<<T<<endl;   
 
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n);  (i)++)
#define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++)
#define  rep(i, n)    for(int (i)=0; (i)<(n);  (i)++)
#define  rev(i, n)    for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c)    for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define  ALL(v)       (v).begin(), (v).end()
#define mp            make_pair
#define pb            push_back
template<class T1, class T2> inline void minup(T1& m, T2 x){ if(m>x) m=static_cast<T2>(x); }
template<class T1, class T2> inline void maxup(T1& m, T2 x){ if(m<x) m=static_cast<T2>(x); }

#define INF 1000000000
#define MOD 1000000009
#define EPS 1E-9

int res[2];
int a, b, c;

int main()
{
  while(scanf("%d,%d,%d", &a, &b, &c) != EOF){
    if(a * a + b * b == c * c) res[0] += 1;
    if(a == b) res[1] += 1;
  }

  cout << res[0] << endl << res[1] << endl;

  return 0;
}

C++: //0032
#include <bits/stdc++.h>
using namespace std;

int main(){
	int a,b,c;
	int tyo = 0,hishi = 0;
	while(scanf("%d,%d,%d\n",&a,&b,&c) != EOF){
		if(a*a+b*b == c*c)
			tyo++;
		if(a == b)
		 	hishi++;
	}
	cout<<tyo<<endl;
	cout<<hishi<<endl;

	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
	int a, b, c;
	int a2, b2, c2;
	int num = 0, num1 = 0;
	char dot, dot1;

	while ( cin >> a >> dot >> b >> dot1 >> c )
	{
		a2 = a * a;
		b2 = b * b;
		c2 = c * c;

		if ( a == b )
		{
			if ( a2 + b2 != c2 )
				num1 = num1 + 1;
		}
		else 
		{
			if ( a2 + b2 == c2 )
				num = num + 1;
		}
	}

	cout << num << endl;
	cout << num1 << endl;

	return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
	int side[3];
	int iso=0, cho=0;
	while(cin>>side[0]>>side[1]>>side[2]){
		if(side[0]==side[1]) iso++;
		else if( (side[0]*side[0]) + (side[1]*side[1]) == (side[2]*side[2]) ) cho++;
	}
	cout<<iso<<" "<<cho<<endl;
	return 0;
}

C++: #include<iostream>
#include<sstream>
#include<fstream>
#include<cstdio>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<string>
using namespace std;

int main(){
	int a,b,c;
	int r = 0,l = 0;	
	while(scanf("%d,%d,%d",&a,&b,&c)==3){
		if(pow(c,2)==pow(a,2)+pow(b,2)){
			++r;
		}else if(a==b){
			l++;
			cout<<a<<":"<<b<<":"<<c<<endl;
		}
	}
	cout<<r<<endl<<l<<endl;
	return 0;
}