#include <bits/stdc++.h>
using namespace std;
int main(){
	int n;cin>>n;
	string s1,s2;
	int k1,k2;k1=k2=0;
	while(n--){
		cin>>s1>>s2;
		if(s1>s2)k1+=3;
		else if(s1<s2)k2+=3;
		else k1+=1,k2+=1;
	}
	cout<<k1<<' '<<k2<<endl;
	return 0;
}
