#include <bits/stdc++.h>
int main(void) {
  int a, b, c, rect = 0, rho = 0;
  while (scanf("%d,%d,%d", &a, &b, &c) != EOF) {
    if (!(a > c && b > c)) {
      if (a == b) {
        rho++;
      } else {
        rect++;
      }
    }
  }
  printf("%d\n", rect);
  printf("%d\n", rho);
  return 0;
}
