#include<bits/stdc++.h>
using namespace std;
typedef long long int lld;

int main(){
  int a,b,c;
  int t = 0,h = 0;
  while(scanf("%d,%d,%d",&a,&b,&c) != EOF){
    int m = max(a,max(b,c));
    //if(a == b && a == c) continue;
    if(m == c){
      if(a == b) h++;
      else t++;
    }
  }
  cout << t << endl << h << endl;
}