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