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<string>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main(void){

	int a,b,c;
	int x=0,y=0;
	while(scanf("%d,%d,%d",&a,&b,&c)!=EOF){
        if(a*a+b*b==c*c){
            x++;
            //cout<<a<<b<<c<<endl;
        }
        if(a==b){
            y++;
           // cout<<a<<b<<c<<'.'<<endl;
        }
	}
	cout<<x<<endl<<y<<endl;


	return 0;
}

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

int main(void) {
    string s;
    int rect = 0, rhom = 0;
    while (cin >> s) {
        replace(s.begin(), s.end(), ',', ' ');
        stringstream ss(s);
        int x, y, z;
        ss >> x >> y >> z;

        if (x == y || y == z || z == x) rhom++;
        else if (x*x + y*y == z*z) rect++;
    }

    cout << rect << endl;
    cout << rhom << endl;

    return 0;
}

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

int main() {
  int a, b, c, r = 0, L = 0;
  char d;
  while (cin >> a >> d >> b >> d >> c) {
    if (a * a + b * b == c * c) r++;
    else if (a == b) L++;
  }
  cout << r << "\n" << L << "\n";
}

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

int main(){
  int a,b,c;
  int Rec=0,Dia=0;

  while(std::scanf(" %d,%d,%d",&a,&b,&c)+1){
    if(a*a+b*b==c*c){
      Rec++;
    }
    if(a==b){
      Dia++;
    }
  }
  std::cout << Rec << std::endl;
  std::cout << Dia << std::endl;
}

C++: #include<iostream>
#include<vector>
#include<string>
#include<cmath>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
using namespace std;
typedef long long ll;

int main(){
  IOS;
  int a,b,c, rec, loz;
  char cha;
  rec=0; loz=0;
  while(cin>>a>>cha>>b>>cha>>c){
    if(pow(a,2)+pow(b,2)==pow(c,2)){
      rec+=1;
    } else if(a==b){
      loz+=1;
    }
  }
  cout << rec << endl;
  cout << loz << endl;
  return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main(){
	int edge[3],rec = 0,loz = 0;
	for(;;){
		if(scanf("%d,%d,%d",&edge[0],&edge[1],&edge[2]) == EOF){break;}
		if(edge[2]*edge[2] == edge[1]*edge[1] + edge[0]*edge[0]){rec++;}
		else if(edge[0] == edge[1]){loz++;}
	}
	cout<<rec<<endl<<loz<<endl;
	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string.h>
#include <bitset>
#include <queue>
#include <map>
#include <string>
#include <stack>
#include <utility>
#include <queue>
#include <cmath>
#define mp make_pair
#define pii pair<long long int,long long int> 
#define ff first
#define pb push_back
#define ss second
#define ll long long 
#define ull unsigned long long
#define vi vector<long long int>
#define vii vector<pii>
#define vvi vector <vi>
#define rep(x,a,b,c) for(int x=a;x<=b;x+=c)
#define repp(x,a,b) rep(x,a,b,1)
#define rev(x,a,b,c) for(int x=a;x>=b;x-=c)
#define revv(x,a,b) rev(x,a,b,1)
#define OO (int)2e9
#define INF (ll)1e18
 
using namespace std;

int a,b,c,rect,pal;

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

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

using namespace std;

int main(void) {
	int tyou = 0, hisi = 0;
	while(1) {
		int a, b, c;
		if( scanf("%d,%d,%d", &a, &b, &c) == EOF )	{ break; }
		if(a == b) {
			hisi++;
		} else if( b * b + a * a == c * c ) {
			tyou++;
		}
	}
	cout << tyou << endl << hisi << endl;
	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;
    char ch;
    int rect = 0;
    int dia = 0;
    while(cin >> a >> ch >> b >> ch >> c) {
        if (a*a + b*b == c*c) rect++;
        else if (a == b) dia++;
    }
    cout << rect << endl << dia << endl;
    return 0;
}

C++: #include <stdio.h>

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

	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", &a, &b, &c)!=EOF){
    if(a==b || a==c || b==c){
      if(a+b>c && b+c>a && c+a>b){
        hishi++;
    }else{
      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 <iostream>
using namespace std;

int main(){
  int a,b,c;
  char c1,c2;

  int rect=0, loz=0;
  while( cin>>a>>c1>>b>>c2>>c && (a|b|c) ){
    if( a*a + b*b == c*c ){
      rect++;
    }else if(a==b) {
      loz++;
    }
  }
  cout << rect << endl << loz << endl;
  return 0;
}

C++: #include <cstdio>

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

  return 0;
}

C++: #include <cstdio>
int main(){
	int a,b,c,sq=0,di=0;
	while(scanf("%d,%d,%d",&a,&b,&c)!=EOF){
		if(a*a+b*b==c*c)sq++;
		else if(a==b)di++;
	}
	printf("%d\n%d\n",sq,di);
	return 0;
}

C++: #include<iostream>

using namespace std;

int main(){

  int in[3];
  char trash;
  int sumr = 0, suml = 0;
  while(cin >> in[0] >> trash >> in[1] >> trash >> in[2]){
    if(in[0]+in[1] < in[2]) continue;
    if(in[0] * in[0] + in[1] * in[1] == in[2]*in[2]) sumr++;
    else if(in[0] == in[1]) suml++;
  }

  cout << sumr << endl << suml << endl;
  return 0;
}

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

int main()
{
	int t=0, h=0;
	int a, b, c;
	string buf;
	while(cin>>buf){
		sscanf(buf.c_str(),"%d,%d,%d", &a, &b, &c);
		cout<<a<<b<<c;
		vector<int> all;
		all.push_back(a);
		all.push_back(b);
		all.push_back(c);
		sort(all.begin(), all.end());
		if(all[0]==all[1]) h++;
		if(all[0]*all[0]+all[1]*all[1]==all[2]*all[2]) t++;
	}
	cout<<t<<endl<<h<<endl;
	return 0;
}

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

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