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 <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
using namespace std;

#define pb         push_back
#define mp         make_pair
#define ll         long long
#define PI         acos(-1.0)
#define ALL(A)     ((A).begin(), (A).end())
#define vsort(v)   sort(v.begin(),v.end())
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)

int main(){
    int a,b,c;
    int sq=0,hishi=0;
    while(scanf("%d,%d,%d\n",&a,&b,&c)==1){
        if(a*a+b*b==c*c) sq++;
        else if(a==b) hishi++;
    }
    cout << sq << endl;
    cout << hishi << endl;
}

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

int main() {
	int a, b, c;
	int rec = 0, rho = 0;

	while (scanf("%d,%d,%d", &a, &b, &c) != EOF) {
		if (a == b) {
			rho++;
		}
		if ((a * a) + (b * b) == (c * c)) {
			rec++;
		}
	}
	cout << rec << endl << rho << endl;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
	ios_base::sync_with_stdio( false );

	int x = 0;
	int y = 0;

	int a, b, c;
	char d;
	while( cin >> a >> d >> b >> d >> c ) {
		if( a == b ) {
			x += 1;
		}
		else if( a*a + b*b == c*c ) {
			y += 1;
		}
	}

	cout << y << '\n' << x << '\n';
}

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

int main() {
    int side1, side2, diagonal, numOfRectangles = 0, numOfLozenges = 0;
    while (scanf("%d,%d,%d", &side1, &side2, &diagonal) != EOF) {
        if (side1 * side1 + side2 * side2 == diagonal * diagonal)
            numOfRectangles++;
        if (side1 == side2)
            numOfLozenges++;
    }
    cout << numOfRectangles << endl
         << numOfLozenges << endl;
}

C++: #include <iostream>

int pow2(int x);

int main()
{
    int side1, side2, diagonal;
    int cnt_rect = 0, cnt_lozen = 0;

    while (std::cin >> side1 >> side2 >> diagonal) {
        if (pow2(side1) + pow2(side2) == pow2(diagonal)) {
            cnt_rect++;
        }
        if (side1 == side2) {
            cnt_lozen++;
        }
    }

    std::cout << cnt_rect << std::endl << cnt_lozen << std::endl;

    return 0;
}

int pow2(int x)
{
    return (x * x);
}

C++: #include <algorithm>
#include <functional>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <climits>

#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

const int INF=100000000;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
using namespace std;
typedef pair<int ,int > P;
typedef long long ll;

int main() {
    int a[3];
    int cnt1=0,cnt2=0;
    while(~scanf("%d,%d,%d",&a[0],&a[1],&a[2])) {
        if(a[2]*a[2]==a[0]*a[0]+a[1]*a[1]) cnt1++;
        if(a[0] == a[1] ) cnt2++;
    }
    cout<<cnt1<<endl;
    cout<<cnt2<<endl;
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,ans1=0,ans2=0;
  char x[3];
  while(cin >> a && a != EOF){
    cin >> x[0] >> b >> x[1] >> c;
    if( a*a + b*b == c*c)ans1++;
    if(a == b)ans2++;
  }
  cout << ans1 << endl << ans2 <<endl;
  return 0;
}

C++: #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>

using namespace std;

int main()
{
	int rectangle = 0, diamond = 0, l1, l2, diagonal;
	string buffer;

	while ( getline( cin, buffer ) )
	{
		for ( unsigned int i = 0; i < buffer.length(); i++ )
		{
			if ( buffer[i] == ',' )
			{
				buffer[i] = ' ';
			}
		}

		istringstream( buffer ) >> l1 >> l2 >> diagonal;

		if ( pow( l1, 2 ) + pow( l2, 2 ) == pow( diagonal, 2 ) )
		{
			rectangle++;
		}

		if ( l1 == l2 )
		{
			diamond++;
		}
	}

	cout << rectangle << ' ' << diamond << endl;
	
	return 0;
}

C++: #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>
#include <ctime>
#include <cstdlib>

using namespace std;

inline int to_int(string s) {int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string to_str(T x) {ostringstream sout; sout << x; return sout.str();}

typedef long long ll;

int main()
{
	//tall:高さ wide:幅 diag:対角線
	int tall, wide, diag;
	//rect:長方形 loze:菱形
	int rect = 0, loze = 0;
	while(scanf("%d,%d,%d",&tall, &wide, &diag) != EOF)
	{
		if(diag == sqrt(tall*tall + wide*wide))
		{
			rect++;
		}
		else if(tall == wide)
		{
			loze++;
		}
	}
	printf("%d\n%d\n",rect, loze);
}

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

C++: #include <iostream>
#include <algorithm>
#include <list>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cfloat>
#include <climits>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <numeric>
#include <functional>
#include <utility>
#include <iomanip>
#include <iterator>
#include <stack>
#include <limits>
#include <sstream>
#include <fstream>
#include <ostream>
#include <bitset>
#include <queue>
#include <ctime>
#include <utility>

#define ms(a,n) (memset(a,n,sizeof(a)))
#define msv(a,v,n) for(int _a;_a<=n;_a++) a[_a]=v;
#define all(res) res.begin(),res.end()
#define mp(a,b) (make_pair(a,b))
#define pb(n) push_back(n)
#define mod 1000000007

using namespace std;

template<class T1> void deb(T1 e){cout<<e<<'\n';}
template<class T1,class T2> void deb(T1 e1,T2 e2){cout<<e1<<" "<<e2<<'\n';}
template<class T1,class T2,class T3> void deb(T1 e1,T2 e2,T3 e3){cout<<e1<<" "<<e2<<" "<<e3<<'\n';}
template<class T1,class T2,class T3,class T4> void deb(T1 e1,T2 e2,T3 e3,T4 e4){cout<<e1<<" "<<e2<<" "<<e3<<" "<<e4<<'\n';}
template<class T> inline T gcd(T a,T b) {if(a<0)return gcd(-a,b);if(b<0)return gcd(a,-b);return (b==0)?a:gcd(b,a%b);}
template<class T> inline T lcm(T a,T b) {if(a<0)return lcm(-a,b);if(b<0)return lcm(a,-b);return a*(b/gcd(a,b));}

typedef long long ll;
typedef pair< int, int> PII;
typedef vector< int> VI;
typedef vector< vector<int> > VVI;
typedef map< string, int> MSI;

ostream_iterator<int> screen(cout," ");
//copy(all(res),screen);

const int  sz=2*1000*100+10;
const int inf=INT_MAX>>1;
const ll big=(1LL<<62);
const double pi =acos(-1.0);
int dx[]={0,0,1,-1,1,1,-1,-1},dy[]={1,-1,0,0,1,-1,1,-1};
VI res;

ll powermod(ll n,ll p)
{
    ll x=1,y=n%mod;
    while(p)
    {
        if(p&1LL)
            x=(y*x)%mod;
        y=(y*y)%mod;
        p=p>>1LL;
    }
    return x;
}

int main()
{
    //std::ios_base::sync_with_stdio(false);
    int r=0,ro=0,a,b,c;
    char ch;
    while(cin>>a>>ch>>b>>ch>>c)
    {
        if(a!=b&&a*a+b*b==c*c)
            r++;
        else if(a==b&&a+b>c)
            ro++;
    }
    cout<<r<< ' '<<ro<<endl;
    return 0;
}