#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int a[3], b = 0, c = 0;
  while (cin >> s) {
    a[0] = s[0] - '0';
    a[1] = s[2] - '0';
    a[2] = s[4] - '0';
    if (a[0] == a[1]) b++;
    if (a[0] * a[0] + a[1] * a[1] == a[2] * a[2]) c++;
  }
  cout << c << endl << b << endl;
}
