#include <bits/stdc++.h>
int main() {
  int h, w, n, hishi = 0, tyou = 0;
  while (scanf("%d,%d,%d", &h, &w, &n) != EOF) {
    if (h == w && h != n) {
      hishi++;
    } else if (h != w) {
      tyou++;
    }
  }
  printf("%d\n%d\n", hishi, tyou);
  return 0;
}
