#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  char str[6];
  int cnt1 = 0, cnt2 = 0;
  while (cin >> str) {
    a = str[0] - '0';
    b = str[2] - '0';
    c = str[4] - '0';
    if (a * a + b * b == c * c) cnt1++;
    if (a == b) cnt2++;
  }
  cout << cnt1 << endl << cnt2 << endl;
  return 0;
}
