#include <bits/stdc++.h>
void sort(int array[], int num) {
  int i;
  int sorted = num - 1;
  int last_sort;
  while (sorted) {
    last_sort = 0;
    for (i = 0; i < sorted - 1; i++) {
      if (array[i] > array[i + 1]) {
        int temp = array[i];
        array[i] = array[i + 1];
        array[i + 1] = temp;
        last_sort = i;
      }
    }
    sorted = last_sort;
  }
}
int main() {
  int count_rectangle = 0;
  int count_diamond = 0;
  int input[3];
  while (scanf("%d,%d,%d", &input[0], &input[1], &input[2]) != EOF) {
    sort(input, 3);
    if ((input[0]) * (input[0]) + (input[1]) * (input[1]) ==
        (input[2]) * (input[2]))
      count_rectangle++;
    else if (input[0] == input[1] || input[1] == input[2])
      count_diamond++;
  }
  printf("%d\n%d\n", count_rectangle, count_diamond);
  return 0;
}
