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<cstdio>
using namespace std;
int main(){
  int a,b,c,x = 0,y = 0;
  while(scanf("%d,%d,%d",&a,&b,&c) != EOF){
    if(a*a+b*b == c*c) x++;
    else if(a == b) y++;
  }
  cout <<x<<endl<<y<<endl;
  return 0;
}

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

int main(void){
  int s1, s2, dg, rec = 0, rho = 0;
  while(scanf("%d,%d,%d", &s1, &s2, &dg) != EOF){
    if(s1 * s1 + s2 * s2 == dg * dg) rec++;
    else if(s1 == s2) rho++;
  }
  cout << rec << endl << rho << 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<algorithm>
using namespace std;

int main(){

  int a[5],count = 0,count2 = 0;

  while( scanf("%d,%d,%d",&a[0],&a[1],&a[2]) != EOF ){

    if(a[0] + a[1] >= a[2]){
      if(a[2] * a[2] == a[0] * a[0] + a[1] * a[1]) count++;
      else count2++;
    }

  }

  cout << count << endl << count2 << endl;
}

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

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

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

int main(void){

	int rectangle=0, lozenge=0;

	while (true){
		int a,b,c;
		char e;
		cin>>a>>e>>b>>e>>c;
		if (cin.eof()) break;
		if (a==b) lozenge++;
		if (a*a+b*b==c*c) rectangle++;
	}
	cout<<rectangle<<endl;
	cout<<lozenge<<endl;
	return 0;
}

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

int main()
{

	int a,b,c,ans = 0,ans2 = 0;

	while(scanf("%d,%d,%d",&a,&b,&c) != EOF)
	{

		if(a == b && a!=c)
		{
			ans += 1;
		}

		else if(a != b && a!=c && b!=c)
		{
			ans2 += 1;
		}

	}

	cout << ans << endl;
	cout << ans2 << endl;

	return 0;
}

C++: #include "bits/stdc++.h"

#define ALL(a) (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define DESCSORT(c) sort(c.begin(), c.end(), greater<int>())

using namespace std;

using LL = long long int;
using LD = long double;

using pii = pair<int, int>;
using pll = pair<LL, LL>;
using pdd = pair<double, double>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vl = vector<LL>;
using vvl = vector<vl>;
using vvvl = vector<vvl>;
using vd = vector<double>;
using vvd = vector<vd>;
using vs = vector<string>;
using vb = vector<bool>;
using vvb = vector<vb>;

const int INF = (1 << 30) - 1;
const LL INF64 = ((LL)1 << 62) - 1;
const double PI = 3.1415926535897932384626433832795;

const int dy[] = { 0, 1, 0, -1 };
const int dx[] = { 1, 0, -1, 0 };

int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
LL gcd(LL x, LL y) { return y ? gcd(y, x % y) : x; }

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

	int rectangle = 0, diamondShape = 0;

	int a, b, c; char c1, c2;
	while (cin >> a >> c1 >> b >> c2 >> c) {
		if (a == b) {
			diamondShape++;
		} else if (a * a + b * b == c * c) {
			rectangle++;
		}
	}

	cout << diamondShape << endl;
	cout << rectangle << endl;
	return 0;
}

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

using namespace std;

int main(void){
	int m, n, l, ans1 = 0, ans2 = 0;
	double sm, sn, sl;
	while(scanf("%d%*c%d%*c%d",&m,&n,&l) != EOF){
		sm = pow((double)m,2.0), sn = pow((double)n,2.0), sl = pow((double)l,2.0);
		if(sm + sn == sl){
			ans1++;
		}else if(m == n && 2 * m > l){
			ans2++;
		}
	}
	printf("%d\n%d\n",ans1,ans2);
	return 0;
}

C++: #include <iostream>

using namespace std;

int main(void){
	char buf;
	int a,b,c;
	int rec=0,loz=0;
	while(true){
		cin >> a >> buf >> b >> buf >> c;
		if(cin.eof())
			break;
		if(c*c== (a*a+b*b))
			rec++;
		if(a==b)
			loz++;
	}
	cout << rec << endl << loz <<endl;
	return 0;
}

C++: #include "stdio.h"

#define SQ(X) ((X)*(X))

/** Application main entry point. */
int main (
  int     argc,
  char  * argv[ ]
  )
{
  int A, B, O;
  int rectNum = 0,
      diamNum = 0;

  while ( scanf ( "%d,%d,%d", &A, &B, &O ) == 3 )
  {
    rectNum += !! ( SQ(A) + SQ(B) == SQ(O) );
    diamNum += !! ( SQ(A)         == SQ(B) );
  }

  printf ( "%d\n%d\n", rectNum, diamNum );

  return ( 0 );
}

C++: #include<iostream>
#include<sstream>
#include<fstream>
#include<cstdio>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<string>
using namespace std;

int main(){
	int a,b,c;
	int r = 0,l = 0;	
	while(scanf("%d,%d,%d",&a,&b,&c)==3){
		if(pow(c,2)==pow(a,2)+pow(b,2)){
			++r;
		}else if(a==b){
			l++;
		}
	}
	cout<<r<<endl<<l<<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 <cmath>
#include <vector>
#include <cstdio>
#include <algorithm>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define repp(i,r,n) for(int i=r;i<(int)n;i++)
using namespace std;
int in(){int x;cin>>x;return x;}

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



}

C++: //長方形⇔直角三角形、ひし形⇔2等辺三角形
//長方形かつひし形の物は、両方カウント
#include<stdio.h>
#include<iostream>
using namespace std;

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

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

int main()
{
	int t=0, h=0;
	set<vector<int> > T, H;
	int a, b, c;
	string buf;
	while(cin>>buf){
		if(buf=="0") break;
		sscanf(buf.c_str(),"%d,%d,%d", &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] || all[1]==all[2]) H.insert(all);
		if(all[0]*all[0]+all[1]*all[1]==all[2]*all[2]) T.insert(all);
	}
	cout<<T.size()<<endl<<H.size()<<endl;
	return 0;
}

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

#define INPUT_FROM_FILE (0) 
#if INPUT_FROM_FILE
#include <fstream>
#endif


int main(int argc, char **argv){
	std::vector<int> v(3);
	char tmp;
	int num_rectangle = 0;
	int num_rhombus = 0;

#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
	//FILE *fp = fopen("test.txt", "r");
#endif



#if INPUT_FROM_FILE
	while(ifs >> v[0] >> tmp >> v[1] >> tmp >> v[2]){
#else
	while(std::cin >> v[0] >> tmp >> v[1] >> tmp >> v[2]){
#endif
		
		//std::sort(v.begin(), v.end());

		if(v[0] * v[0] + v[1] * v[1] == v[2] * v[2]){
			num_rectangle++;
		}
		else if(v[0] == v[1]){
			num_rhombus++;
		}
	}
	std::cout << num_rectangle << std::endl;
	std::cout << num_rhombus << std::endl;
	return 0;
}