#include <bits/stdc++.h>
using namespace std;
int main() {
  int ca = 0;
  int cb = 0;
  int a, b, c;
  char n;
  while (a != EOF) {
    cin >> a >> n >> b >> n >> c;
    if ((a * a) + (b * b) == c * c) {
      ++ca;
    }
    if (a == b && a + b > c) {
      ++cb;
    }
  }
  cout << ca << endl << cb << endl;
  return 0;
}
