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

#define rep(i, n) for(int i = 0; i < n; i ++)
#define ALL(T) T.begin(), T.end()

using namespace std;

typedef pair<int, int> pii;
typedef unsigned long long ull;

int main(void){
    int nt = 0, nh = 0;
    for(int a, b, c; ~scanf("%d,%d,%d", &a, &b, &c);){
        if(a == b) nh ++;
        else if(a * a + b * b == c * c) nt ++;
    }
    cout << nt << endl << nh << endl;

    return 0;
}

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

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{
      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<stdio.h>

int main(){
 int l1,l2,dia,rc,lc;
 rc=lc=0;
 while(scanf("%d %d %d",&l1,&l2,&dia)!=EOF){
  if(l1*l1+l2*l2==dia*dia){
   rc++;
  }
  if(l1==l2){
   lc++;
  }
 }
 printf("%d\n%d\n",rc,lc);
 return 0;
}

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

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

C++: #include<stdio.h>
int main(void)
{
	int a, b, r;
	int rectangle = 0, rhombus = 0;
	while(scanf("%d,%d,%d", &a, &b, &r) == 3)
	{
		if(a == b)
			rhombus++;
		else if(a*a + b*b == r*r)
			rectangle++;
	}
	printf("%d\n%d\n", rectangle, rhombus);
	return 0;
}

C++: #include <cstdio>

int main() {
    int a,b,r;
    int re = 0;
    int rh = 0;

    while (scanf("%d,%d,%d", &a, &b, &r) != EOF) {
        if (a == b) {
            rh++;
        } else if ((a * a) + (b * b) == (r * r)) {
            re++;
        }
    }

    printf("%d\n%d\n", re, rh);

    return 0;
}

C++: #include <iostream>
int main()
{
	int a, b, c, n = 0, m = 0;
	char t;
	while (std::cin >> a >> t >> b >> t >> c)
	{
		if (a*a + b*b == c*c) n++;
		if (a == b) m++;
	}
	std::cout << n << '\n' << m << '\n';
}

C++:  
 #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 #include<queue>
 
 using namespace std;
  
 int main()
 {
   int a,b,c;
   int arr[100005][3];
   int count1=0;
   int count2=0;
   int count=0;
   char temp,temp1;
   bool flag;
   while(cin>>a>>temp>>b>>temp1>>c)
   {
     flag=false;
     arr[count][0]=a;
     arr[count][1]=b;
     arr[count][2]=c;
     sort(arr[count],arr[count]+3);
     a=arr[count][0];
     b=arr[count][1];
     c=arr[count][2];
     count++;
       for(int i=0;i<count-1;i++)
       {
         if(a==arr[i][0]&&b==arr[i][1]&&c==arr[i][2])
         {
           flag=true;
           break;                                            
         }        
       }             
       if(!flag) 
       {
         if(a*a+b*b==c*c) count1++;
         else count2++;          
       } 
      //if(count==4) break;                               
   }
   cout<<count1<<endl;
   cout<<count2<<endl;  
   //while(1);     
   return 0;  
 }

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

C++: #include <stdio.h>
int main() {int i,j,k,A=0,B=0;while (scanf("%d,%d,%d",&i,&j,&k)!=EOF) {if (k*k==i*i+j*j) A++; else if (i==j) B++;} printf("%d\n%d\n",A,B);return 0;}

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

using namespace std;

#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define repr(i, j) for(int i = j; i >= 0; --i)
#define INF (1 << 30)
#define MOD 1e9 + 7

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

int num[5000];

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

C++: #include <iostream>
#include <cstdio>
using namespace std;
//菱形
bool rhombus(int a, int b, int c) {
    return(a == b && (a < c < a + b));
}
//長方形
bool rectangle(int a, int b, int c) {
    return(a != b && (a*a + b*b == c*c));
}
int main(void) {
    int a, b, c;
    int ans1 = 0, ans2 = 0;
    while(scanf("%d,%d,%d", &a, &b, &c) != EOF) {
        if(rectangle(a, b, c)) ans1++;
        else if(rhombus(a, b, c)) ans2++;
    }
    cout << ans1 << endl << ans2 << endl;
    return(0);
}

C++: #include<functional>
#include<algorithm>
#include<iostream>
#include<utility>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#define REP(i,n) for(int i=0;i<n;i++)
#define LOOP(i,x,n) for(int i=x;i<n;i++)
#define ALL(v) (v).begin(),(v).end()
#define pf push_front
#define pb push_back
#define int long long
using namespace std;
const int INF=1000000007;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

signed main(){
  int a,b,c;
  char k;
  int ans1=0,ans2=0;
  while(cin>>a>>k>>b>>k>>c){
    if((a*a+b*b)==c*c)ans1++;
    if(a==b&&a!=c)ans2++;
  }
  cout<<ans1<<endl;
  cout<<ans2<<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;
    string s;
    int rect = 0;
    int dia = 0;
    while(cin >> s) {
        a = s[0] - '0';
        b = s[2] - '0';
        if (a == b) dia++;
        else rect++;
    }
    cout << rect << endl << dia << endl;
    return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int a, b; //隣り合う辺の長さ
    int c; //対角線の長さ
    int rectangular = 0, rhombus = 0; //長方形と菱形の個数
      
    while(scanf("%d,%d,%d", &a, &b, &c) != EOF){
        if(a * a + b * b == c * c) rectangular++;
        else if(a == b) rhombus++;
    }
    cout << rectangular << endl;
    cout << rhombus << endl;
}