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 <algorithm>
#include <map>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>

using namespace std;

int main(void)
{
    ios::sync_with_stdio(false);
    int a,b,c;
    int ans1,ans2;
    ans1=ans2=0;
    while(~scanf("%d,%d,%d",&a,&b,&c)) {
        if(a*a + b*b == c*c) ans1++;
        if(a==b) ans2++;
    }
    cout << ans1 << endl;
    cout << ans2 << endl;

    return 0;
}

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++: #include <iostream>
using namespace std;

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

C++: // #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <string>
using namespace std;

#define TYO 0
#define HIS 1

int main(){
	int in1, in2, in3;
	int ans[2] = {};

	while (scanf("%d,%d,%d", &in1, &in2, &in3) != EOF){
		// 長方形check
		if (pow(in1, 2) + pow(in2, 2) == pow(in3, 2)){
			ans[TYO]++;
		}
		else if (in1 == in2){
			ans[HIS]++;
		}
	}
	for (int i = 0; i < 2; i++){
		cout << ans[i] << endl;
	}

	return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;
int main() {
	int n1,n2,n3,tyo=0,hisi=0;
	while (scanf("%d,%d,%d",&n1,&n2,&n3)!=EOF) {
		if (n1 == n2)hisi++;
		if (n1*n1 + n2*n2 == n3*n3)tyo++;
	}
	cout << tyo << endl<<hisi<<endl;
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define INF LLONG_MAX - 100
#define MOD 1000000007
#define fcout cout << fixed << setprecision(15)
#define int long long
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
#define lowb lower_bound
#define upb upper_bound
typedef long long ll;
typedef pair<int, int> P;
typedef priority_queue<int> pque;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a/gcd(a,b)*b;};
int mod(int a,int b){return (a+b-1)/b;};
int month[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;};
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;};



signed main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);

	int ans1 = 0, ans2 = 0;
	int a, b, c;
	while(scanf("%lld,%lld,%lld", &a, &b, &c) != EOF) {
		if(a * a + b * b == c * c) ans1++;
		if(a == b) ans2++;
	}
	cout << ans1 << endl;
	cout << ans2 << endl;
	return 0;
}

C++: #include <stdio.h>
 
int main(void)
{
    int hen1, hen2, taikaku;
    int tyouhoukei, hishigata; 
     
    tyouhoukei = 0;
    hishigata = 0;
     
    while(scanf("%d, %d, %d" , &hen1, &hen2, &taikaku) != EOF){
         
        if ((hen1 * hen1) + (hen2 * hen2) == (taikaku * taikaku)){
            tyouhoukei++;
        }
         
        else if (hen1 == hen2){
            hishigata++;
        }
    }
     
    printf("%d\n" , tyouhoukei);
    printf("%d\n" , hishigata);
     
    return (0);
}

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

int main() {
	int len1,len2,dia;
	int rectangle = 0,lozenge = 0;
	
	while( scanf("%d,%d,%d",&len1,&len2,&dia) == 3 ){
		if ( len1 * len1 + len2 * len2 == dia * dia ){
			rectangle++;
		} else if( len1 == len2 ) {
			lozenge++;
		}
	}
	
	cout << rectangle << endl << lozenge << endl;
	
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void)
{
	int a,b,c;
	int rec=0;
	int loz=0;
	while(scanf("%d,%d,%d",&a,&b,&c)!=EOF){
		if(a==b) loz++;
		if(a*a+b*b==c*c) rec++;
	}
	cout << rec << endl;
	cout << loz << endl;
	return 0;
}

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

using namespace std;

int main() {

	int a,b,c;
	int counter1 = 0;
	int counter2 = 0;
	char d;
	while (cin >> a >> d >> b >> d >> c) {
		if (c * c == a * a + b * b) {
			counter1++;
		} else if (c < a + b && a == b){
			counter2++;
		}
	}

	cout << counter1 << endl << counter2 << endl;

	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;

int main(){
    int hi= 0,tyou = 0;
  int a,b,c;
  while(~scanf("%d,%d,%d",&a,&b,&c)){

    a = pow(a,2);
    b = pow(b,2);
    c = pow(c,2);
    if(c == a+b)tyou++;
    else if(a != c+b && b != a+c)hi++;
}
  cout << tyou << endl<< hi << endl;
  return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main(){
  int a,b,c;
  int t=0,h=0;
  while(scanf("%d,%d,%d",&a,&b,&c)){
    // if(a==0)break;
    if(a==b)h++;
    if(c*c==a*a+b*b)t++;
  }
  cout<<t<<endl<<h<<endl;
}

C++: 3,4,5
5,5,8
4,4,4
5,4,3

C++: #include<iostream>
#include<string>
#include<sstream>
using namespace std;
int s2i(string str){
  istringstream iss(str);
  int x;iss >> x;
  return x;
}
int main(){
  int r=0,q=0;
  string str;
  while(cin >> str){
    for(int i=0;i<str.size();i++) if(str[i]==',') str[i]=' ';
    stringstream ss(str);
    int a,b,c; ss >> a >> b >> c;
    if(a*a+b*b==c*c) r++;
    if(a==b) q++;

  }

  cout << r << endl << q << endl;
}

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

C++: #include<iostream>
#include<stdio.h>
#include<vector>
#include<utility>
#include<queue>
#include<math.h>
#include<string>
#include<typeinfo>
using namespace std;
typedef pair<int, int> P;
int main() {
	int tyo = 0, hisi = 0,a, b, c;
	char ch;
	string str;
	while (cin >> a >> ch >> b >> ch >> c) {
		 if (pow(c, 2) == pow(b, 2) + pow(a, 2))tyo++;
		 if (a == b)hisi++;
	}
	cout << tyo << endl << hisi << endl;

	return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>

int main()
{
	int NumOfC = 0;
	int NumOfH = 0;

	char c;

	int l1, l2, l3;

	while(std::cin>> l1 >> c >> l2 >> c >> l3)
	{
		if(l1*l1+l2*l2 == l3*l3)
		{
			++NumOfC;
		}

		if(l1 == l2)
		{
			++NumOfH;
		}
	}

	std::cout << NumOfC << '\n' << NumOfH << '\n';
}

C++: #include <cstdio>

using namespace std;

int main(){
  int n, s1, s2, d, rect = 0, dia = 0;
  while (scanf("%d,%d,%d", &s1, &s2, &d) != EOF) {
    if (s1 * s1 + s2 * s2 == d * d) rect++;
    if (s1 == s2) dia++;
  }
  printf("%d\n%d\n", rect, dia);
  return 0;
}