#include <bits/stdc++.h>
using namespace std;
int main() {
  int in[3];
  char trash;
  int sumt = 0, sumh = 0;
  while (cin >> in[0] >> trash >> in[1] >> trash >> in[2]) {
    sort(in, in + 3);
    if (in[1] == in[0] && in[2] == in[0]) {
    } else if (in[2] * in[2] == in[0] * in[0] + in[1] * in[1]) {
      sumt++;
    } else if (in[0] == in[1] || in[1] == in[2]) {
      sumh++;
    }
  }
  cout << sumt << endl << sumh << endl;
  return 0;
}
