#include <bits/stdc++.h>
using namespace std;
int StrToInt(string);
string IntToStr(int);
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
int main(void) {
  char cc;
  int a, b, c;
  int hisi = 0;
  int cho = 0;
  while (cin >> a >> cc >> b >> cc >> c) {
    if (a != b && b != c && a != c) {
      cho++;
    } else if (a == b && b == c) {
    } else {
      hisi++;
    };
  }
  cout << hisi << endl;
  cout << cho << endl;
  return 0;
}
