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 <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <cctype>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <fstream>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); }
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }

int main()
{
	int rect = 0, hishi = 0;
	char k;
	
	int a, b, c;
	while(cin >> a >> k >> b >> k >> c)
	{
		if(pow(a, 2.0) + pow(b, 2.0) == pow(c, 2.0))
			rect++;
		if(a == b)
			hishi++;
	}

	cout << rect << endl << hishi << endl;
}

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

int main(){
int a,b,c,x=0,y=0;
while(scanf("%d,%d,%d",&a,&b,&c)!=EOF){

if(a*a+b*b==c*c)y++;
else if(a==b)x++;
}
printf("%d?\n%d?\n",y,x);
return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <stdlib.h>

int main(){
  int a, b, c;
  int tyou = 0;
  int hishi = 0;
  
  while(scanf("%d,%d,%d\n", &a, &b, &c)!=EOF){
    if(a==b || a==c || b==c){
      if(a+b>c && b+c>a && c+a>b){
        hishi++;
      }
    }
      if(a>b){
        if(a>c){
          if(a*a==b*b+c*c) tyou++;
        }else{
          if(c*c==a*a+b*b) tyou++;
        }
      }else{
        if(b>c){
          if(b*b==a*a+c*c) tyou++;
        }else{
          if(c*c==a*a+b*b) tyou++;
        }
      }
    
  }
  
  std::cout << tyou << std::endl << hishi << std::endl;
  
  return 0;
}

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

int main() {
    int a, b, c;
    int r1 = 0, r2 = 0;
    while(~scanf("%d,%d,%d", &a, &b, &c)) {
        r1 += a * a + b * b == c * c;
        r2 += a == b;
    }
    cout << r1 << "\n" << r2 << endl;
}

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

C++: #include <iostream>
#include <math.h>
#define PI 3.141592
using namespace std;

int main() {
int a,b,c,tyo=0,hishi=0;
char d,e;
while(cin>>a>>d>>b>>e>>c){
	if(a*a+b*b==c*c){
		tyo=tyo+1;
	}
	if(a==b){
		hishi=hishi+1;
	}
}
cout<<tyo<<endl;
cout<<hishi<<endl;
}

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

using namespace std;

vector<string> split(const string &str, char delim = ' ') {
  stringstream ss(str);
  vector<string> res;
  for (string tmp; getline(ss, tmp, delim);) res.push_back(tmp);
  return res;
}

template<typename T = long long> inline T toInteger(const string&);

template<> inline int toInteger<int>(const string& s) {
  return stoi(s);
}

template<> inline long toInteger<long>(const string& s) {
  return stol(s);
}

template<> inline long long toInteger<long long>(const string& s) {
  return stoll(s);
}

template<typename T = long long> inline T toInteger(const string& s, int n) {
  T res = 0;
  for (char c : s) {
    if (isdigit(c)) res = res * n + c - '0';
    else if (isalpha(c)) res = res * n + tolower(c) - 'a' + 10;
  }
  return s[0] == '-' ? -res : res;
}

int main() {
  string line;
  int res1 = 0, res2 = 0;
  while (cin >> line) {
    auto v = split(line, ',');
    int a = toInteger<int>(v[0]);
    int b = toInteger<int>(v[1]);
    int c = toInteger<int>(v[2]);
    if (a * a + b * b == c * c) ++res1;
    if (a == b) ++res2;
  }
  cout << res1 << endl << res2 << endl;
}

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

int main(){
  int a,b,c;
  char ch1,ch2;
  int ans1=0,ans2=0;
  while(cin>>a>>ch1>>b>>ch2>>c){
    if(a*a+b*b==c*c)ans1++;
    if(a==b) ans2++;
  }
  cout<<ans1<<endl<<ans2<<endl;
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <sstream>
#include <string>
#include <cmath>

using namespace std;

vector<string> split(const string &s, char delim) {
    vector<string> elems;
    string item;
    for (char ch: s) {
        if (ch == delim) {
            if (!item.empty())
                elems.push_back(item);
            item.clear();
        } else {
            item += ch;
        }
    }
    if (!item.empty())
        elems.push_back(item);
    return elems;
}

int main() {
    string buffer;
    int vedge, hedge, diagonal, countRect = 0, countRhom = 0;


    while (cin >> buffer) {
        vector<string> buffers = split(buffer, ',');
        
        vedge = stoi(buffers[0]);
        hedge = stoi(buffers[1]);
        diagonal = stoi(buffers[2]);
        
        if (vedge == hedge) {
            countRhom++;
        }
        if (pow(vedge, 2) + pow(hedge, 2) == pow(diagonal, 2)) {
            countRect++;
        }
    }

    cout << countRect << endl;
    cout << countRhom << endl;

    return 0;
}

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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int rectangle=0, lozenge=0;
    while(true){
        int a, b, c;
        if(!(cin>>a)) break;
        cin.ignore();
        cin>>b;
        cin.ignore();
        cin>>c;
        if(a==b) ++lozenge;
        else if(a*a+b*b==c*c) ++rectangle;
    }
    cout<<rectangle<<'\n'<<lozenge<<'\n';
    return 0;
}

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

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define For(i,a,b) for(int (i)=(a); (i)<(b); (i)++)

int main() {
    int a, b, c;
    string s;
    int rect = 0;
    int dia = 0;
    while(cin >> s) {
        a = s[0] - '0';
        b = s[2] - '0';
        c = s[4] - '0';
        if (a == b) {
            dia++;
            if (a*a + b*b == c*c) rect++;
        }
        else {
            if (a*a + b*b == c*c) rect++;
        }
    }
    cout << rect << endl << dia << 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;
	while(getline(cin,str,',')){
		string str2;
		getline(cin,str2,',');

		string str3;
		getline(cin,str3);

		int edge1 = atoi(str.c_str());
		int edge2 = atoi(str2.c_str());
		int diag = atoi(str3.c_str());

		if(edge1 + edge2 <= diag || (edge1 == edge2 && edge1 == diag)) continue;

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

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

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

void solve()
{
	int rectCount = 0;
	int diamondCount = 0;
	int a, b, c;
	while(scanf("%d,%d,%d", &a, &b, &c) != EOF)
	{
		if(a * a + b * b == c * c)
		{
			++rectCount;
		}
		if(a == b)
		{
			++diamondCount;
		}
	}
	cout << rectCount << endl;
	cout << diamondCount << endl;
}

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