#include <iostream>
#include <string>
using namespace std;
int main(){
  int i, n, t=0, h=0;
  string a, b;
  cin >> n;
  for (i=0; i<n; i++) {
    cin >> a >> b;
    if (a > b) t+=3;
    else if (a < b) h+=3;
    else t++, h++;
  }
  cout << t << " " << h << endl;
}
