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
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <complex>
#include <math.h>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long, long> PLL;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(long i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

const long double EPS = 1e-12;
const LL INF = 1e18;


int main(){
	int a,b,c;
	char c1,c2;
	int cntr=0,cnth=0;
	while(cin>>a>>c1>>b>>c2>>c){
		if(a==b)cnth++;
		if(a*a+b*b==c*c)cntr++;
	}
	cout<<cntr<<endl;
	cout<<cnth<<endl;
	return 0;
}
/*

*/

C++: #include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <string>
#include <map>
#include <vector>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

int main(void)
{
    int a, b, c, rec = 0, rho = 0;
    
    while (~scanf("%d,%d,%d", &a, &b, &c)) {
        if (hypot(a, b) == c)
            rec++;
        else if (a == b)
            rho++;
    }
    
    cout << rec << endl << rho << endl;

    return 0;
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>

using namespace std;


#define all(c) ((c).begin()), ((c).end())
#define debug(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); i <= (int)(b); i++)

#define mp make_pair
#define fst first
#define snd second
#define pb push_back


const double EPS = 1e-10;


typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef complex<double> P;

int main() {
	char d;
	int rect = 0, rhom = 0;
	for (int a, b, c; cin >> a >> d >> b >> d >> c; ) {
		if(c * c == a * a + b * b) rect++;
		if(a == b) rhom++;
	}
	cout << rect << endl << rhom << endl;
	
	return 0;
}

C++: #include<iostream>

using namespace std;

int pow(int x){
	return x*x;
}

int main(){
	int a,b,c;
	int ans1=0;
	int ans2=0;
	char ch;
	while(cin>>a>>ch>>b>>ch>>c){
		if(pow(a)+pow(b)==pow(c))ans1++;
		else if(a==b)ans2++;
	}
	
	cout<<ans1<<endl<<ans2<<endl;
}

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

  }
  cout << ans[1] << endl;
  cout << ans[0] << endl;
}

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

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

int main(){
  int a,b,c,cnt_tyou=0,cnt_hishi=0;
  while(scanf("%d,%d,%d",&a,&b,&c) != EOF){
    if(a==b) cnt_hishi++;
    if(a*a + b*b == c*c) cnt_tyou++;
  }
  cout<<cnt_tyou<<endl<<cnt_hishi<<endl;
  return 0;
}

C++: #include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <stdio.h>

using namespace std;

int sa, sb, d;

vector<string> &split(const string &s, char delim, vector<string> &elems) {
    stringstream ss(s);
    string item;
    while(getline(ss, item, delim)) {
        elems.push_back(item);
    }
    return elems;
}


vector<string> split(const string &s, char delim) {
    vector<string> elems;
    return split(s, delim, elems);
}

int toint(string s) {
    istringstream ss(s);
    int ans;
    ss >> ans;
    return ans;
}

int main(void) {
    string s;
    int rec = 0, loz = 0;
    while(getline(cin, s)) {
        vector<string> v = split(s, ',');
        sa = toint(v[0]);
        sb = toint(v[1]);
        d = toint(v[2]);

        if(sa == sb) loz++;
        if(sa * sa + sb * sb == d * d) rec++;
    }
    cout << rec << endl << loz << endl;
    return 0;
}

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

int main() {
	int a, b, c;
	char r;
	int rec, loz;
	while (cin >> a >> r >> b >> r >> c){
		if (a == b){
			loz += 1;
		}else if (a * a + b * b == c * c){
			rec += 1;
		}
	}
	cout << rec << endl << loz << endl;
}

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

int main()
{
	int a,b,c;
	char d;
	int l=0,h=0;
	while(cin >> a >> d >> b >> d >> c){
		if(pow(a,2) + pow(b,2) == pow(c,2)){
			if(a == b)
				if(a != c)
					++h;
			else
				++l;
		}
	}
	
	cout << l << endl << h << endl;
	
	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
using namespace std;

int main(){
	int a,b,c,t=0,h=0;
	char k;
	while(cin>>a){
		//if(a==0)break;
		cin>>k>>b>>k>>c;
		if(a*a+b*b==c*c && a!=b) t++;
		else if(a==b) h++;
	}
	cout<<t<<endl<<h<<endl;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int main()
{
//	cut here before submit 
//	freopen("testcase.pb", "r", stdin);
	string str = "";

	int rect = 0;
	int loze = 0;

	while (getline (cin, str ) ){
		int a, b, c;

		while (str.find(',') != string::npos ){
			str = str.replace(str.find(','), 1, " ");
		} // end while

		stringstream ss(str);
		ss >> a >> b >> c;
		if (a != 0 && b != 0 && c != 0){
			if (a == b){
				++loze;
			} // end if
			if (a*a + b*b == c*c){
				++rect;
			} // end if
		} // end if
	} // end while

	cout << rect << endl;
	cout << loze << endl;
	
	return 0;
}

C++: #include <stdio.h>

int main(void) {

  int vert,horiz,diag;
  int rect=0,diam=0;

  while(scanf("%d,%d,%d",&vert,&horiz,&diag)!=EOF) {

    if(vert*vert+horiz*horiz==diag*diag) rect++;

    if(vert==horiz && vert+horiz>diag) diam++;

  }

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

  printf("%d\n",diam);

  return 0;

}