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++: //#define _GRIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;

// ?????¬???????????¬??????
#pragma region MACRO
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define PED cout << "\n"
#define rep(i,n) for(int i=0; i<(int)n; ++i)
#define REP(i,x,n) for(int i=x; i<(int)n; ++i)
#define repi(i,n) for(int i=0; i<=(int)n; ++i)
#define REPI(i,x,n) for(int i=x; i<=(int)n; ++i)
#define ILP while(true)
#define FOR(i,c) for(__typeof((c).begin())!=(c).begin(); i!=(c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#pragma endregion

// ???
#pragma region TYPE_DEF
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<string, string> pss;
typedef pair<string, int> psi;
typedef pair<int, string> pis;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long double> vld;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<string> vs;
#pragma endregion

// Effective std
#pragma region ESTD
template<typename C, typename T> int count(C& c, T t) { return count(ALL(c), t); }
template<typename C, typename F> int count_if(C& c, F f) { return count_if(ALL(c), f); }
template<typename C, typename T> void erase(C& c, T t) { remove(ALL(c), t), c.end(); }
template<typename C> void remove(vector<C>& c, unsigned int index) { c.erase(c.begin()+index); }
template<typename C, typename T, typename U> void replace(C& c, T t, U u) { replace(ALL(c), t, u); }
template<typename C, typename F, typename U> void replace_if(C& c, F f, U u) { (ALL(c), f, u); }
template<typename C> void reverse(C& c) { reverse(ALL(c)); }
template<typename C> void sort(C& c) { sort(ALL(c)); }
template<typename C, typename Pred> void sort(C& c, Pred p) { sort(ALL(c), p); }
#pragma endregion

// ?????°
#pragma region CONST_VAL
constexpr int PI = (2*acos(0.0));
constexpr int EPS = (1e-9);
constexpr int MOD = (int)(1e9+7);
constexpr int INF = 100000000;
#pragma endregion


int main()
{
    int num_rect = 0;
    int num_lozen = 0;
    int side1, side2, diagonal;
    char c;
    while(cin>>side1>>c>>side2>>c>>diagonal) {
        if(side1*side1+side2*side2==diagonal*diagonal) {
            num_rect++;
        } else if (side1==side2) num_lozen++;
    }
    cout << num_rect << "\n" << num_lozen << endl;
    return 0;
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
using namespace std;

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

#define all(c) (c).begin(), (c).end()
#define pb push_back
#define mp make_pair
#define EXIST(v,i) (find(all(v), i) != (v).end())
#define ERASE(v,i) (v).erase(remove(all(v), i), (v).end())
#define INDEX(v,i) (find(all(v), i) - (v).begin())
#define rep(i,n) for(int i = 0; i < (int)n; ++i)
#define debug(x) cerr << #x << " = " << (x) << endl;

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

const int INF = 100000000;
const double PI = 3.14159265358979323846;
const double EPS = 1e-10;

int main() {
	vector<int> cnt(2);
	for(int a, b, c; ~scanf(" %d,%d,%d", &a,&b,&c);) {
		if(c*c == a*a + b*b) cnt[0]++;
		else if(a == b) cnt[1]++;
	}
	printf("%d\n%d\n", cnt[0], cnt[1]);
	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", &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>
using namespace std;

int main() {
	int a, b, c;
	int ca=0, cb=0;
	while (scanf("%d, %d, %d", &a, &b, &c)+1) {
		if ((a*a) + (b*b) == c*c) { ca++; }

		if (a == b) { cb++; }
	}
	printf("%d\n%d\n", ca, cb);
	return 0;
}

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

int main(void)
{
	int a,b;
	int t;

	int countt=0;
	int counth=0;

	string input;
	string n;

	stringstream ss;

	while(1)
	{
		cin >> input;
		if(cin.eof())
			break;
		ss.clear();
		ss << input.substr(0,input.find(','));
		ss >> a;
		input = input.substr(input.find(',')+1);

		ss.clear();
		ss << input.substr(0,input.find(','));
		ss >> b;
		input = input.substr(input.find(',')+1);

		ss.clear();
		ss << input.substr(0,input.find(','));
		ss >> t;
		if(a*a+b*b == t*t)//直角を持つ
		{
			if(a == b);// ++counth;
			else
				++countt;
		}
		else
			if(a == b)
				++counth;
	}
	cout << countt << endl;
	cout << counth << endl;
	//system("pause");
	return 0;
}

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

using namespace std;

int main() {

	int a,b,c;
	int counter1 = 0;
	int counter2 = 0;
	while (cin >> a >> b >> c) {
		if (c * c == a * a + b * b) {
			counter1++;
		} else {
			counter2++;
		}
	}

	cout << counter1 << endl << counter2 << endl;

	return 0;
}

C++: #include <cstdio>
#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 + b) <= c || (b + c) <= a || (a + c) <= b || a > c || b > c)
      continue;
    if ((a * a + b * b) == c * c)
      d++;
    else
      e++;
  }
  cout << d << endl << e << endl;
  return 0;
}

C++: #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++;
            if(a==b)y++;
      }
      printf("%d\n%d\n",x,y);
}

C++: #include <iostream>

using namespace std;

int main(){
	int a, b, c;
	int cho=0;
	int hi=0;

	while(cin >> a >> b >> c){


		if(a*a + b*b == c*c){
			cho++;
		}
		else if(a==b){
			hi++;
		}
	}
	cout << cho << endl << hi << endl;

}

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

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

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

int main(){
	int a, b, c, ans1=0, ans2=0;

	while( scanf("%d,%d,%d", &a,&b,&c) != EOF ){
		if( a*a + b*b == c*c ) ans1++;
		else if( a == b ) ans2++;
	}
	printf("%d\n%d\n", ans1, ans2);
}

C++: #include <iostream>

using namespace std;

int main(int argc, char const* argv[])
{
	int e1,e2,e3;
	int hisi = 0;
	int tyou = 0;
	char comma;

	while( cin >> e1 >> comma >> e2 >> comma >> e3 ){
		if( e1 == e2 ) hisi++;
		else if( e1 * e1 + e2 * e2 == e3 * e3 ) tyou++;
	}

	cout << tyou << endl;
	cout << hisi << endl;

	return 0;
}

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

int main() {
  lli a, b, c;
  int re, hi;
  re = hi = 0;
  while(scanf("%lld,%lld,%lld", &a, &b, &c) != EOF) {
    if(a*a+b*b == c*c) ++re;
    if(a == b) ++hi;
  }
  cout << re << endl;
  cout << hi << endl;
  return 0;
}