Go: package main

import (
	"bufio"
	"os"
	"strings"
	"strconv"
	"fmt"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	d := 0
	e := 0
	for scanner.Scan() {
		info := strings.Split(scanner.Text(), ",")
		a, _ := strconv.Atoi(info[0])
		b, _ := strconv.Atoi(info[1])
		c, _ := strconv.Atoi(info[2])
		if a*a + b*b == c*c {
			d++
		}
		if a == b {
			e++
		}
	}
	fmt.Println(d)
	fmt.Println(e)
}

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

C++: #include <bits/stdc++.h>
using namespace std;
 
int main()
{
    char ch;
    int re = 0, ro = 0;
    int a, b, c;
    while (cin >> a >> ch >> b >> ch >> c) {
        if (a * a + b * b == c * c) {
            re++;
        }
        if (a == b) {
            ro++;
        }
    }
    cout << re << endl;
    cout << ro << endl;
}

C++: #include <bits/stdc++.h>
  
using namespace std;
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)
  
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()
  
#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD
 
int main(){
  int a,b,c;
  int x=0,y=0;
  while(~scanf("%d%d%d",&a,&b,&c)){
    if(a*a+b*b==c*c)++x;
    if(a==b)++y;
  }
  cout<<x<<endl;
  cout<<y<<endl;
  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\n", &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>
#include <cmath>
#include <cstdio>
using namespace std;

int main() {
	int tyo = 0, hisi = 0;

	while (true) {
		int a, b, c;
		char knm;
		cin >> a >> knm >> b >> knm >> c;
		if (cin.eof() || a == 0) { break; }

		if(pow(c,2)==pow(a,2)+pow(b,2)){
			tyo++;
		}
		else if(a==b){
			hisi++;
		}
	}
	cout << tyo << endl
		<< hisi << endl;
	return 0;
}

C++: #include<iostream>
#include <math.h>

using namespace std;

int main(void){
    double h1 ,h2 ,x;
    int rectangle= 0 ,rhombus= 0;
    char dummy;
    
    while ( cin>>h1>>dummy>>h2>>dummy>>x )
    {
        if (h1==h2) rhombus++;
        if (hypot(h1, h2)==x) rectangle++;
    }
    
    cout<<rectangle<<endl<<rhombus<<endl;
    
    return 0;
}

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

int main()
{
	int a, b, c = 0;
	char s;
	int rect_num = 0;
	int diamond_num = 0;
	while (std::cin >> a >> s >> b >> s >> c)
	{
		int a2 = std::pow(a, 2);
		int b2 = std::pow(b, 2);
		int c2 = std::pow(c, 2);
		if ((a2 + b2) == c2)
		{
			rect_num++;
		}
		else
		{
			if ((a + b <= c) && (a == b))
			{
				diamond_num++;
			}
		}
	}
	std::cout << rect_num << std::endl;
	std::cout << diamond_num << std::endl;

	return 0;
}

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

int main(){
  string d1,d2,d3;
  int a1,a2,a3;
  int c1,c2;
  while(getline(cin,d1,',')){
    a1 = atoi(d1.c_str());
    getline(cin,d2,',');
    a2 = atoi(d2.c_str());
    getline(cin,d3,'\n');
    a3 = atoi(d3.c_str());
    if(a1+a2>a3){
      if (a1*a1+a2*a2==a3*a3)
	c1++;
      if (a1==a2)
	c2++;
    }
  }
  cout <<c1<<endl<<c2<<endl;
  return 0;
}

C++: #include <iostream>
#include <limits>
#include <cmath>
#include <sstream>

using namespace std;

int main() {

	int a,b,c,p = 0,l = 0;
	while (scanf("%d,%d,%d",&a,&b,&c) != EOF) {
		if (a*a + b*b == c*c) p++;
		if (a == b) l++;
	}

	cout << p << endl << l << endl;

	return 0;
}

C++: #include<iostream>
#include<deque>
#include<algorithm>
#include<cstdio>
using namespace std;
int main(void){
	deque<int> in;
	int a,b,c;
	int tyou=0,hisi=0;
	while(scanf("%d,%d,%d",&a,&b,&c)!=EOF){
		if(in.empty()==false)
			in.clear();
		in.push_back(a);
		in.push_back(b);
		in.push_back(c);
		sort(in.begin(),in.end());
		//cout<<in[0]<<in[1]<<in[2]<<endl;
		if(in[0]==3 &&in[1]==4&&in[2]==5)
			tyou++;
		if(in[0]==5 &&in[1]==5&&in[2]==8)
			hisi++;
	}
	cout<<tyou<<endl<<hisi<<endl;

	return 0;
}

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

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

bool isRectangle(int a, int b, int c);
bool isLozenge(int a, int b);

int main()
{
    int a;
    int b;
    int c;
    int rect_num = 0;
    int loze_num = 0;
    string in_str;
    while(getline(cin, in_str))
    {
        sscanf(in_str.c_str(),"%d,%d,%d",&a,&b,&c);
        if(isRectangle(a, b, c))
        {
            rect_num++;
        }
        if(isLozenge(a, b))
        {
            loze_num++;
        }
    }
    cout << rect_num << endl;
    cout << loze_num << endl;
    return 0;
}

bool isRectangle(int a, int b, int c)
{
    if(a * a + b * b == c * c)
    {
        return true;
    }
    else
    {
        return false;
    }
}

bool isLozenge(int a, int b)
{
    if(a == b)
    {
        return true;
    }
    else
    {
        return false;
    }
}

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;
}

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

int main() {
	
	int edge1, edge2, diag;
	char a, b;
	int Rcount = 0, Hcount = 0;
	while(cin >> edge1 >> a >> edge2 >> b >> diag){
		if(pow(edge1, 2.0) + pow(edge2, 2.0) == pow(diag, 2.0))
			Rcount++;
		
		if(edge1 == edge2)
			Hcount++;
	}
	
	cout << Rcount << endl;
	cout << Hcount << endl;
	return 0;
}

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

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

C++: #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include "bits/stdc++.h"
#define REP(i,a,b) for(int i=a;i<b;++i)
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define ALL(a) begin(a),end(a)
#define ifnot(a) if(not (a))
#define dump(x)  cerr << #x << " = " << (x) << endl
using namespace std;

// #define int ll
#ifdef _MSC_VER
const bool test = true;
#else 
const bool test = false;
#endif

int dx[] = { 0,1,0,-1 };
int dy[] = { 1,0,-1,0 };
#define INF (1 << 28)
ull mod = (int)1e9 + 7;
//.....................
const int MAX = (int)2e5 + 5;

int main() {
	int a, b, c;
	int res1 = 0;
	int res2 = 0;
	while (scanf("%d,%d,%d", &a, &b, &c) != EOF) {
		if (c == (ll)(hypot(a, b) + 1e-6)) res1++;
		if (a == b && 2*a > c) res2++;
	}
	cout << res1 << endl;
	cout << res2 << endl;
	return 0;
}