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>

using namespace std;

int main(void){
	int hisi,chouhoukei,length[3];
	hisi=chouhoukei=0;
	while(scanf("%d,%d,%d",&length[0],&length[1],&length[2])!=EOF){
		
		
		
		if(length[0]==length[1]){
			hisi++;
		}
		else if(length[0]*length[0]+length[1]*length[1]==length[2]*length[2]){
			chouhoukei++;
		}
	}
	cout<<chouhoukei<<endl<<hisi<<endl;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <functional>
#include <sstream>
#include <cstdio>
#include <stack>
using namespace std;

// Plastic Board(0032)
int main()
{
	//freopen("0032.txt", "r", stdin);
	int r1 = 0, r2 = 0;
	int s1, s2, d;
	while (scanf("%d,%d,%d", &s1, &s2, &d) != EOF) {
		if (s1*s1 + s2*s2 == d*d)
			++r1;
		else if (s1 == s2)
			++r2;
	}
	cout << r1 << endl << r2 << endl;
	return 0;
}

C++: #include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <string>
using namespace std;

#define rep(i,n) for(int i=0;i<int(n);++i)

int tyo=0,his=0;
int h1,h2,h3;
char t;


void solve(){
	while(cin>>h1>>t>>h2>>t>>h3){
		if(h1==h2){
			his++;
		}
		if(h3*h3==(h1*h1)+(h2*h2)){
			tyo++;
		}
	}
	cout<<tyo<<endl<<his<<endl;
}



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

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

int main()
{
    char c;
    int line[2],centerLine,squareCount=0,diamondCount=0;
    while(cin>>line[0]>>c>>line[1]>>c>>centerLine){
        if(line[0]!=line[1]&&sqrt(line[0]*line[0]+line[1]*line[1])==centerLine){
            squareCount++;
        }
        if(line[0]==line[1]&&centerLine!=0){
            diamondCount++;
        }
    }
    cout<<squareCount<<endl<<diamondCount<<endl;
}

C++: #include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <sstream>
#include <cmath>
#include <climits>
#include <map>

using namespace std;

#define reep(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reep(i,0,n)

typedef vector<int> vi;

int main()
{
	int a, b, c;
	int rect=0, hishi=0;
	while(scanf("%d,%d,%d", &a, &b, &c) != EOF){
		hishi += a==b;
		rect += a*a+b*b==c*c;
	}
	printf("%d\n%d\n", rect, hishi);

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(void){
    int a,b,c,counta,countb;
    counta = 0;
    countb = 0;
    while (scanf("%d,%d,%d", &a,&b,&c)!=EOF) {
        if (a*a+b*b==c*c) {
            counta++;
        } else if (a==b) {
            countb++;
        }
    }
    cout << counta << endl;
    cout << countb << endl;
}

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

int main() {
	int  right = 0, diamond = 0;
	int a, b, c;
	while (scanf("%d,%d,%d", &a, &b, &c) == 3) {
		if (a*a + b*b == c*c) right++;
		if (a == b) diamond++;
	}
	cout << right << endl << diamond << endl;
	return 0;
}

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

int main(){
	char a;
	int l[3];
	int ans[2] = {0};


	while(cin >> l[0] >> a >> l[1] >> a >> l[2]){
		if(l[2] * l[2] == l[0] * l[0] + l[1] * l[1])
			ans[0]++;
		else if(l[0] == l[1])
			ans[1]++;
	}

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

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

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

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

C++: #include<iostream>
#include<cmath>
int main()
{
	int cnt[2] = { 0,0 };
	while (true)
	{
		int a, b, c;
		char foo;
		std::cin >> a >> foo >> b >> foo >> c;
		if (std::cin.eof())
		{
			break;
		}
		if (c == hypot(a, b))
		{
			cnt[0]++;
		}
		else if (a == b)
		{
			cnt[1]++;
		}
	}
	std::cout << cnt[0] << std::endl;
	std::cout << cnt[1] << std::endl;
	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <cstdio>
using namespace std;
int main(){
	int a,b,c,tyou=0,hisi=0;
	while(scanf("%d,%d,%d",&a,&b,&c) != EOF){
		if(a*a+b*b==c*c && a!=b) tyou++;
		else if(a==b) hisi++;
	}
	cout<<tyou<<endl<<hisi<<endl;
	return 0;
}

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

#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++)
#define OP(m) cout << m << endl;
typedef long long ll;
typedef unsigned long long ull;

int main()
{
    int a, b, c;
    char t;
    int rectangles = 0, lozengres = 0;
    while (cin >> a >> t >> b >> t >> c)
    {
        if (a * a + b * b == c * c)
        {
            rectangles++;
            if (a == b)
            {
                lozengres++;
            }
        }
        else if (a == b)
        {
            lozengres++;
        }
    }
    OP(rectangles)
    OP(lozengres)
    return 0;
}

C++: #include<iostream>
#include<vector>
#include<cstdio>
#include<algorithm>
using namespace std;
bool slove(int n, int a, int b, int c){ // n=1 ツづ青つオツ形ツ板サツ津ィ n=2 ツ陳キツ陛サツ形ツ板サツ津ィ
	if(n==1){
		if(c*c == a*a + b*b)
			return true;
	}
	if(n==2){
		if((a==b || b==c || c==a) && !(a==b && b==c && c==a))
			return true;
	}
	return false;
}
int main(){
	int a,b,c,con_h=0,con_t=0;
	vector<int> n;
	bool flag;
	while(scanf("%d,%d,%d",&a,&b,&c) != EOF){
		n.clear();
		n.push_back(a); n.push_back(b); n.push_back(c); sort(n.begin(), n.end());
		vector<int>::iterator it = n.begin();
		flag = slove(1, *it,*(it+1),*(it+2)); // ツづ青つオツ形ツ板サツ津ィ
		if(flag == true)
			con_h++;
		else{
			flag = slove(2, *it,*(it+1),*(it+2)); //ツ陳キツ陛サツ形ツ板サツ津ィ
			if(flag == true)
				con_t++;
		}
	}
	cout << con_t << endl << con_h << endl;
}

C++: #include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>

using namespace std;

int main(){
	int a,b,c;
	int ty=0,hi=0;
	
	while(scanf("%d,%d,%d",&a,&b,&c)!=EOF){
		if(a==b)
		hi++;
		else if((a*a)+(b*b)==(c*c))
		ty++;
	}
	printf("%d\n%d\n",ty,hi);
}

C++: #include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
#include<map>
using namespace std;

int main(){
    int mod=1000000007;
    int a,b,c;
    int ans[2]={0,0};
    while (scanf("%d,%d,%d",&a,&b,&c)!=EOF) {
        if (a==b && b==c) continue;
        int tmp=(max(a,max(b,c)))*(max(a,max(b,c)))-(min(a,min(b,c)))*(min(a,min(b,c)));
        if (tmp==a*a || tmp==b*b || tmp==c*c) ans[1]+=1;
        else if (a==b || b==c || a==c) ans[0]+=1;
    }
    printf("%d\n%d\n",ans[0],ans[1]);
    return 0;
}

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

	return 0;
}