#include <bits/stdc++.h>
int main(int argc, char **argv) {
  int i, s, t, u, r, l;
  l = r = 0;
  while (scanf("%d,%d,%d", &s, &t, &u) != EOF) {
    if ((s * s + t * t) == u * u) {
      r++;
    }
    if (s == t || s == u || t == u) {
      l++;
    }
  }
  printf("%d\n%d\n", r, l);
  return 0;
}
