#include <bits/stdc++.h>
int main(void) {
  int a, b, c;
  int rectangle, diamond;
  rectangle = diamond = 0;
  while (scanf("%d,%d,%d", &a, &b, &c) != EOF) {
    assert(a * a + b * b == c * c && a == b);
    if (a * a + b * b == c * c) {
      rectangle++;
    }
    if (a == b) {
      diamond++;
    }
  }
  printf("%d\n%d\n", rectangle, diamond);
  return 0;
}
