#include <bits/stdc++.h>
int main() {
  int a, b, c;
  int tyou = 0;
  int hishi = 0;
  while (scanf("%d,%d,%d\n", &a, &b, &c) != EOF) {
    if (a == b || a == c || b == c) {
      if (a + b > c && b + c > a && c + a > b) {
        hishi++;
      }
    } else {
      if (a > b) {
        if (a > c) {
          if (a * a == b * b + c * c) tyou++;
        } else {
          if (c * c == a * a + b * b) tyou++;
        }
      } else {
        if (b > c) {
          if (b * b == a * a + c * c) tyou++;
        } else {
          if (c * c == a * a + b * b) tyou++;
        }
      }
    }
  }
  std::cout << tyou << std::endl << hishi << std::endl;
  return 0;
}
