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

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

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

C++: #include<iostream>
#include<cmath>
using namespace std;
int main(){
  int a1,a2,a3,count1=0,count2=0,c,c1,c2;
  char b1,b2;
  while(cin>>a1>>b1>>a2>>b2>>a3){
    c=2*(sqrt((a1*a1-a3*a3/4)));
    c1=(a3*a3+c*c);
    c2=(a1+a2)*(a1+a2);
    if(a1*a1+a2*a2==a3*a3)
      count1++;
    else if(c2==c1)
      count2++;
  }
  cout<<count1<<endl<<count2<<endl;

  return 0;
}

C++: #include<stdio.h>
int main(void){
int x,y,z,i,all,cou=0,cou2=0;
while(scanf("%d,%d,%d",&x,&y,&z)!=EOF){
    if(z*z==x*x+y*y)cou++;
    if(x==y){
        if(x+y<z)cou2--;
            cou2++;
    }

}
printf("%d\n%d\n",cou,cou2);
return 0;
}

C++:  
 #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 #include<queue>
 
 using namespace std;
  
 int main()
 {
   int a,b,c;
   int arr[100005][3];
   int count1=0;
   int count2=0;
   int count=0;
   char temp,temp1;
   bool flag;
   while(cin>>a>>temp>>b>>temp1>>c)
   {
     flag=false;
     arr[count][0]=a;
     arr[count][1]=b;
     arr[count][2]=c;
     sort(arr[count],arr[count]+3);
     count++;
       for(int i=0;i<count-1;i++)
       {
         if(a==arr[i][0]&&b==arr[i][1]&&c==arr[i][2])
         {
           flag=true;
           break;                                            
         }        
       }             
       if(!flag) 
       {
         if(a*a+b*b==c*c) count1++;
         else count2++;          
       }                                
   }
   cout<<count1<<endl;
   cout<<count2<<endl;  
   //while(1);     
   return 0;  
 }

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

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 <iostream>
using namespace std;
int main(){
  int a,b,d;
  char c;
  int ans[2] = {0};
  while(cin >> a >>c>> b >>c>> d){
    if(a == b)ans[0]++;
    else if(a*a + b*b == c*c)ans[1]++;

  }
  cout << ans[1] << endl;
  cout << ans[0] << endl;
}

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

typedef complex<double> P;

int main(){
	int s[3];
	int a1=0,a2=0;
	while( scanf("%d,%d,%d",s,s+1,s+2) != -1 ){
		//sort(s,s+3);
		if( s[0] * s[0] + s[1] * s[1] == s[2] * s[2] ){
			a1++;
		}
		if( s[0] == s[1] )
			a2++;
	}
	cout << a1 << endl;
	cout << a2 << endl;
			
}

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

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

C++: 
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <cassert>

using namespace std;


bool solve(){
	int a,b,x;
	char ch, ch2;
	int ans = 0, ans2 = 0;
	while(cin>>a){
		cin>> ch>> b>> ch2>> x;
		if(a*a + b*b == x*x) ans++;
		if(a == b) ans2++;
	}
	cout<< ans<< endl;
	cout<< ans2<< endl;
	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	solve();
	
	return 0;
}