#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, g, m, x = 0, y = 0;
  while (cin >> a >> g >> b >> m >> c) {
    if (c == a * a + b * b) {
      x++;
    } else if (a == b) {
      y++;
    }
  }
  cout << x << endl << y << endl;
  return 0;
}
