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 <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define repp(i, n) rep(i, n)
#define reppp(i, n) repp(i, n)
#define rrepp(i, n) rrep(i, n)
#define repss(i, n) reps(i, n)
#define repcc(i, n) repc(i, n)
#define repii(i, a, b) repi(i, a, b)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ll << (b))

using namespace std;

using i32 = int;
using i64 = long long;
using u64 = unsigned long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vu64 = vector<u64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
inline u64 xorshift() { static u64 x = 88172645463325252ull; x = x ^ (x << 7); return x = x ^ (x >> 9); }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { if (x < y) x = y; }
template <typename T> inline void amin(T &x, T y) { if (x > y) x = y; }
template <typename T> inline T power(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
template <typename T, typename S> istream& operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; }
template <typename T, typename S> ostream& operator<<(ostream &os, pair<T, S> &p) { os << p.first << ' ' << p.second; return os; }

void solve() {
  int a, b, c;
  char _;
  int ans1 = 0, ans2 = 0;
  while (cin >> a >> _ >> b >> _ >> c) {
    if (a * a + b * b == c * c) {
      ans1++;
    } else if (a == b) {
      ans2++;
    }
  }
  cout << ans1 << '\n';
  cout << ans2 << '\n';
}

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

#define SAFE_DELETE( x ) { if ( x ){ delete x; x = NULL; } }

struct tCell{
	tCell() : side1( 0 ), side2( 0 ), diagonal( 0 ), prev( NULL ), next( NULL ){}
	int side1, side2, diagonal;
	tCell *prev, *next;
};

class MyArray{
public:
	MyArray() : mSize( 0 ), head( NULL ), tail( NULL ){
		head = new tCell;
		tail = new tCell;
		head->next = tail;
		tail->prev = head;
	}
	~MyArray(){
		for ( int i = mSize; i > 0; --i ){
			tCell* cell = tail->prev;
			cell->prev->next = cell->next;
			cell->next->prev = cell->prev;
			SAFE_DELETE( cell );
		}
		SAFE_DELETE( tail );
		SAFE_DELETE( head );
	}

	void pushBack( int a, int b, int c ){
		++mSize;
		tCell* cell = new tCell;
		cell->side1 = a;
		cell->side2 = b;
		cell->diagonal = c;
		cell->prev = tail->prev;
		cell->next = tail;
		cell->prev->next = cell;
		cell->next->prev = cell;
	}
	int size(){ return mSize; }

	tCell operator[]( int d ){
		tCell* cell = head->next;
		if ( d >= mSize ){ cell = NULL; return *cell; }
		for ( int i = 0; i < d; ++i ){
			cell = cell->next;
		}
		return *cell;
	}

private:
	int mSize;
	tCell *head, *tail;
};

int main(){
	char c;
	int side1, side2, diagonal;
	MyArray ma;

	while ( cin >> side1 >> c >> side2 >> c >> diagonal ){
		ma.pushBack( side1, side2, diagonal );
	}

	side1 = side2 = 0;

	for ( int i = 0; i < ma.size(); ++i ){
		if ( ma[ i ].side1 == ma[ i ].side2 ){
			++side2;
		}else{
			double oblique = sqrt( pow( static_cast< double >( ma[ i ].side1 ), 2.0 )
								 + pow( static_cast< double >( ma[ i ].side2 ), 2.0 ) );
			if ( static_cast< double >( ma[ i ].diagonal ) == oblique ){
				++side1;
			}
		}
	}

	cout << side1 << endl << side2 << endl;

	return 0;
}

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

bool ishisi(int a,int b, int c)
{
	if(a==b)
		return true;
	return false;
}

bool istyou(int a,int b, int c)
{
	if(a*a+b*b == c*c)
		return true;
	return false;
}

int main()
{
	int a,b,c;
	char dot;
	int hisicount=0;
	int tyoucount=0;
	while(cin >> a && cin >> dot && cin >> b && cin >> dot && cin >> c){
		if(ishisi(a,b,c))
			hisicount++;
		if(istyou(a,b,c))
			tyoucount++;
	}
	cout << tyoucount << endl;
	cout << hisicount << endl;
	return 0;
}

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

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

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

int main(){
    int a,b,c;
    int num[2]={};
    while(scanf("%d,%d,%d", &a, &b, &c)!=EOF){
        if(a+b<=c) continue;
        if(a*a +b*b == c*c) num[0]++;
        if(a==b) num[1]++;
    }
    cout << num[0] << endl << num[1] << endl;
    return 0;
}

C++: #include <iostream>

int main()
{
    int s1, s2, diag, rect = 0, diam = 0;
    char comma;
    while (std::cin >> s1 >> comma >> s2 >> comma >> diag) {
        if (s1 * s1 + s2 * s2 == diag * diag) ++rect;
        else if (s1 == s2) ++diam;
    }
    std::cout << rect << std::endl << diam << std::endl;
}

C++: #include<iostream>

using namespace std;

// 長方形の判定：三平方の定理を使用する。
// ひし形の判定：二つの辺の長さが等しいこと
// 正方形の場合：ひし形、長方形の特殊なケースなので両方にカウント

int main() {
	int a, b, c;
	int r_count = 0; // 長方形の数
	int l_count = 0; // ひし形の数
	// 
	while (true) {
		cin >> a;
		cin.ignore();
		cin >> b;
		cin.ignore();
		cin >> c;
		if (cin.eof()) {
			break;
		}
		// 長方形判定
		if (a * a + b * b == c * c) {
			++r_count;
		}
		// ひし形判定
		if (a == b) {
			++l_count;
		}
	}
	cout << r_count << endl;
	cout << l_count << endl;

	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;



int main()
{
    double a,b,c;
    int d=0,e=0,f=0;
    while(~scanf("%lf,%lf,%lf",&a,&b,&c)&&f<=50)
    {
        f++;
        if(a==b)
        {
            d++;
            if(a*a+b*b==c*c)
            {
                e++;
            }
        }
        else
        {
            if(a*a+b*b==c*c)
            {
                e++;
            }
        }
    }
    printf("%d\n%d\n",e,d);
    return 0;
}