#include<cstdio>
#include<iostream>
#include<string>

using namespace std;

int main(void){

	string TARO,HANAKO;
	int n;
	int Tsco=0,Hsco=0;
	cin>>n;

	for(int i=0;i<n;i++){
		cin>>TARO>>HANAKO;
		if(TARO>HANAKO) Tsco+=3;
		if(TARO==HANAKO) Tsco++,Hsco++;
		if(TARO<HANAKO) Hsco+=3;
	}

	cout<<Tsco<<" "<<Hsco<<endl;

	return 0;
}