#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, ans = 0, ans2 = 0;
  while (scanf("%d,%d,%d", &a, &b, &c) != EOF) {
    if (a == b && a != c && b != c) {
      ans += 1;
    } else if (a != b && a != c && b != c) {
      ans2 += 1;
    }
  }
  cout << ans << endl;
  cout << ans2 << endl;
  return 0;
}
