#include <bits/stdc++.h>
int main() {
  int hisi, tyou, in[3];
  char trash[2];
  hisi = 0;
  tyou = 0;
  while (scanf("%d %c %d %c %d", &in[0], &trash[0], &in[1], &trash[1],
               &in[2]) != EOF) {
    if (in[0] == in[1] && in[0] == in[2]) {
    } else if (in[0] == in[1] || in[0] == in[2]) {
      hisi++;
    } else {
      tyou++;
    }
  }
  printf("%d\n%d\n", tyou, hisi);
  return 0;
}
