#include <bits/stdc++.h>
int main(void) {
  int c;
  int argnum;
  int l1 = 0;
  int l2 = 0;
  int cross = 0;
  int rectnum = 0;
  int diamondnum = 0;
  while (1) {
    c = getchar();
    if (c == EOF) {
      break;
    } else if (c == '\n') {
      if (l1 == 0 && l2 == 0 && cross == 0) {
        break;
      }
      if (l1 * l1 + l2 * l2 == cross * cross) {
        rectnum++;
      } else if (l1 == l2) {
        diamondnum++;
      }
      argnum = 0;
      l1 = 0;
      l2 = 0;
      cross = 0;
    } else if (c == ',') {
      argnum++;
    } else if (argnum == 0) {
      l1 = l1 * 10 + (c - '0');
    } else if (argnum == 1) {
      l2 = l2 * 10 + (c - '0');
    } else if (argnum == 2) {
      cross = cross * 10 + (c - '0');
    }
  }
  printf("%d\n%d\n", rectnum, diamondnum);
  return 0;
}
