#include <bits/stdc++.h>
int main() {
  int a[4096][3], i = 0, j, d, p = 0, q = 0;
  int flag = 0;
  while (scanf("%d,%d,%d", &a[i][0], &a[i][1], &a[i][2]) != EOF) {
    if ((a[i][1] >= a[i][0]) && (a[i][1] >= a[i][2])) {
      d = a[i][0];
      a[i][0] = a[i][1];
      a[i][1] = d;
    }
    if ((a[i][2] >= a[i][1]) && (a[i][2] >= a[i][0])) {
      d = a[i][0];
      a[i][0] = a[i][2];
      a[i][2] = d;
    }
    if (a[i][1] <= a[i][2]) {
      d = a[i][1];
      a[i][1] = a[i][2];
      a[i][2] = d;
    }
    flag = 0;
    for (j = 0; j < i; j++) {
      if ((a[i][0] == a[j][0]) && (a[i][1] == a[j][1]) &&
          (a[i][2] == a[j][2])) {
        flag = 1;
        break;
      }
    }
    if (flag == 1) continue;
    if (a[i][0] * a[i][0] == a[i][1] * a[i][1] + a[i][2] * a[i][2]) p++;
    if (a[i][1] == a[i][2]) q++;
    i++;
  }
  printf("%d\n%d\n", p, q);
  return 0;
}
