#include <bits/stdc++.h>
int main(void) {
  int t = 0, h = 0;
  int x, y, d;
  while (scanf("%d,%d,%d", &x, &y, &d) != EOF) {
    if (x * x + y * y == d * d) t++;
    if ((x == y) && (x * 16 == d * 10)) h++;
  }
  printf("%d\n%d\n", t, h);
  return 0;
}
