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 <fstream>
#include <iostream>
#include <cmath>
#include <vector>
#include <queue>
#include <utility>
#include <algorithm>
using namespace std;

int main() {
  // ifstream cin("../test.txt");
  int a, b, d;
  char x, y;
  int t = 0;
  int h = 0;
  while (cin >> a >> x >> b >> y >> d) {
    if (a * a + b * b == d * d) t++;
    if (a == b) h++;
  }
  cout << t << endl << h << endl;
}

C++: #include<bits/stdc++.h>
using namespace std;
 
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
 
typedef long long ll;
typedef pair<int, int> ii;

#define EPS 1e-8

int main(){
	
	int a, b, c;
	int cnt1 = 0, cnt2 = 0;
	while(scanf("%d,%d,%d", &a, &b, &c) != EOF){
		if(a == b) cnt2++;
		else if(c * c == a * a + b * b) cnt1++;
	}

	cout << cnt1 << endl << cnt2 << endl;
	
	return 0;
}

C++: #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;


int solve(int n, int sum, int amax) {
	if (n == 0) {
		if (sum == 0) {
			return 1;
		}
		else {
			return 0;
		}
	}
	else if (amax*n < sum ||0 * n>sum)return 0;
	else {
		int nans=0;
		for (int x =0; x <= amax; ++x) {
			nans+=solve(n-1,sum-x,x-1);
		}
		return nans;
	}
}


int main() {
	int a,b,c;
	int h=0,ch=0;
	while (scanf("%d,%d,%d",&a,&b,&c)) {
		vector<int>v{ a,b,c };
		sort(v.begin(),v.end());
		a=v[0];
		b=v[1];
		c=v[2];
		if(a==b)h++;
		if(a*a+b*b==c*c)ch++;
	}
	cout<<ch<<endl<<h<<endl;
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <cstdio>
#include <cmath>
#include <istream>
#include <sstream>
#include <iterator>

using namespace std;

typedef ostringstream OSS;
typedef istringstream ISS;

typedef pair<int,int> P_II;

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

int main() {
  int a[100][3];
  int rect = 0, lozen = 0;
  map<string,bool> mp;
  OSS oss;
  
  for(int i = 0; scanf("%d,%d,%d", &a[i][0], &a[i][1], &a[i][2])!=EOF; i++) {
    sort(a[i], a[i]+3);
    oss << a[i][0] << "," << a[i][1] << "," << a[i][2];
    if(!mp[oss.str()]) {
      mp[oss.str()] = true;
      if(a[i][0]*a[i][0] + a[i][1]*a[i][1] == a[i][2]*a[i][2]) rect++;
      else lozen++;
    }
    oss.str("");
  }
  cout << rect << endl << lozen << endl;
  
  return 0;
}

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

C++: #include<iostream>
using namespace std;
int main(){
	int a, b, c, rect = 0, rhom = 0;
	while(cin >> a >> b >> c){
		if( a * a + b * b == c * c ) rect++;
		else if( a == b ) rhom++;
	}
	cout << rect << "?\n" << rhom << endl;
}

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

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

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

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

int main()
{
	char p,q;
	int a,b,c;
	int x=0,y=0;
	while(cin >> a >> p >> b >> q >> c)
	{
		if(a*a+b*b==c*c)	x++;
		if(a==b)			y++;
	}
	cout << x << endl << y << endl;
}

C++: #include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
typedef pair<char, int>P;

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

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
	int a[100],b[100],c[100],num=0,num1=0;
	while(scanf("%d,%d,%d",&a[0],&b[0],&c[0])!=EOF)
	{
	 for(int i=1;i<4;i++)	
         scanf("%d,%d,%d",&a[i],&b[i],&c[i]);
   	 for(int i=0;i<4;i++)	
    {
    	if(a[i]*a[i]+b[i]*b[i]==c[i]*c[i]&&a[i]<c[i]&&b[i]<c[i]&&a[i]>0&&b[i]>0&&c[i]>0)
		  num++;
		 if(a[i]==b[i]&&a[i]+b[i]>c[i]&&a[i]-b[i]<c[i]&&a[i]>0&&b[i]>0&&c[i]>0)
		 	 num1++;
    }

    cout<<num<<endl;
	cout<<num1<<endl;
	num=0;
	num1=0;
	}
	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    int ret1 = 0;
    int ret2 = 0;

    for(;;){
        int x, y, z;
        char c;
        if(!(cin >> x >> c >> y >> c >> z))
            break;
        if(x * x + y * y == z * z)
            ++ ret1;
        else if(x == y)
            ++ ret2;
    }

    cout << ret1 << endl << ret2 << endl;
}

C++: #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>

using namespace std;
typedef long long ll;

int paper[10][10]={0};

void drop(int x,int y){
    
    if(0<=x && x<10 && 0<=y && y<10){
        paper[x][y]++;
    }
    
}

int main(){
    int a[3],ans_cho=0,ans_hishi=0;
    
    while(EOF!=scanf("%d,%d,%d",&a[0],&a[1],&a[2])){
        
        if(a[0]*a[0]+a[1]*a[1]==a[2]*a[2])
            ans_cho++;
        
        if(a[0]==a[1])
            ans_hishi++;
        
        
    }
    
    printf("%d\n%d\n",ans_cho,ans_hishi);
    
    return 0;
}

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

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

int main() {
	int sides[3]; int square = 0, para = 0;
	while (scanf("%d,%d,%d", &sides[0], &sides[1], &sides[2]) != EOF) {
		//??£?????¢???check
		if (sides[0] * sides[0] + sides[1] * sides[1] == sides[2] * sides[2]) {
			square++; para++;
		}
		//??????????????¢???check
		else if (sides[0] == sides[1]) {
			para++;
		}
		cout << square << endl << para << endl;
	}
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<list>
using namespace std;
int inf = 1000000000;

int main(void) {

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


  return 0;
}


// EOF

C++: #include <stdio.h>

#define SQ(x) ((x) * (x))

int main(void)
{
	int a, b, c;
	int t, h;
	char buf[256];
	
	t = h = 0;
	while (fgets(buf, 256, stdin) != NULL){
		sscanf(buf, "%d,%d,%d", &a, &b, &c);
		
		if (SQ(a) + SQ(b) == SQ(c)){
			t++;
		}
		if (a == b){
			h++;
		}
	}
	
	printf("%d\n%d\n", t, h);
	
	return (0);
}