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