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 <algorithm>
#include <vector>

using namespace std;

int main(void){
  int rectangle=0;
  int lozenge=0;
  int x,y,z;
  int i,n=0;
  pair<int, pair<int, int> > tri[10000];
  bool isok = true;

  while(cin >> x){
	cin.ignore();
	cin >> y;
	cin.ignore();
	cin >> z;
	vector<int> edge;
	pair<int, int> tmp1;
	edge.push_back(x);
	edge.push_back(y);
	edge.push_back(z);
	
	sort(edge.begin(), edge.end());
	tmp1 = pair<int , int>(edge[1],edge[2]);
	
	for(i=0;i<n;i++){
	  if(tri[i] == pair<int, pair<int , int> >(edge[0], tmp1)){
		isok = false;
	  }
	}

	if(isok){
	  tri[n++] = pair<int, pair<int, int> >(edge[0], tmp1);
	  //cerr << n << ":added" << edge[0] << " " << edge[1] << " " <<edge[2] << " " << endl;
	  if(edge[0] * edge[0] + edge[1] * edge[1] == edge[2] * edge[2]){
		rectangle++;
	  }else{
		lozenge++;
	  }
	}
	isok = true;
  }

  cout << rectangle << endl;
  cout << lozenge << endl;

  return 0;
}

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

int main()
{
	int a,b,c,tc,rc;
	tc = rc = 0;
	while(scanf("%d,%d,%d",&a,&b,&c) == 3)
	{
		if(a == b) ++ rc;
		else if(a * a + b * b == c * c) ++tc;
	}
	printf("%d\n%d\n",tc,rc);
	return 0;
}

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

using namespace std;

bool is_rectangle(int a, int b, int d) { return a * a + b * b == d * d; }

bool is_rhombus(int a, int b, int d) { return a == b; }

int main() {
  char *line = NULL;
  size_t buffer_size = 0;
  int num_rectangles = 0, num_rhombus = 0;
  while (getline(&line, &buffer_size, stdin) > 0) {
    int a, b, d;
    sscanf(line, "%d,%d,%d", &a, &b, &d);
    if (is_rectangle(a, b, d)) { ++num_rectangles; }
    if (is_rhombus(a, b, d)) { ++num_rhombus; }
  }
  free(line);

  printf("%d\n%d\n", num_rectangles, num_rhombus);

  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)!=-1) {
		vector<int>v{ a,b,c };
		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>

using namespace std;


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

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

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

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 <bits/stdc++.h>
using namespace std;

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

C++: #include<stdio.h>
#include<string>
#include<stdlib.h>
#include<math.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<string.h>
#include<map>
#include<queue>

using namespace std;

typedef pair<int,int> pii;

#define rep(i,j) for(int i=0;i<(j);i++)
#define reps(i,j,k) for(int i=j;i<=k;i++)
#define in(i,j,k) ((i)>=(j)&&(i)<=(k))


int main(){
	int a,b,l,r=0,h=0;
	while(~scanf("%d,%d,%d",&a,&b,&l)){
		if(a==b)h++;
		if(l*l==a*a+b*b)r++;
	}
	printf("%d\n%d\n",r,h);
	return 0;
}

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

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

  cout << choho << endl;
  cout << hishi << endl;
  return 0;
}

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

int main(void){
	int a,b,c;
	char temp;
	int hisi = 0, cho = 0;
	while(!cin.eof()){
		cin >> a >> temp >> b >> temp >> c;
		if(a*a + b*b == c*c)
			cho++;
		if(a == b)
			hisi++;
	}
	cout << cho << endl << hisi << endl;
}

C++: //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <queue>
#include <iterator>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int gcd(int a, int b){
   int tmp;
   while(a%b==0){
      tmp=a%b;
      a=b;
      b=tmp;
   }
}

int lcm(int a,int b){
   return a*b/gcd(a,b);
}

bool prime_number(int n){
   vector<bool> i;
   if(n < 2){
      return false;
   }
   else if(n == 2){
      return true;
   }
   if(n % 2 == 0){
      return false;
   }
   for(int i=3;i<=n/i;i+=2){
      if(n % i == 0) return false;
      return true;
   }
}

int main(){
   int a,b,c,t,h=0;
   char d;
   
   while(cin >> a >> d >> b  >> d >> c){
      if(a==b) h++;
      if(a!=b&&c==sqrt(a*a+b*b)) t++;
   }
   cout << t << endl;
   cout << h << endl;
}