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