#include <iostream>
#include <string>
using namespace std;

int main(){
	int a,taro=0,hanako=0;
	string s1,s2;
	
	cin>>a;
	
	for(int i=0;i<a;i++){
		cin>>s1>>s2;
		if(s1==s2){
			taro++;
			hanako++;
		}else if(s1>s2){
			taro+=3;
		}else if(s1<s2){
			hanako+=3;
		}
	}
	cout<<taro<<" "<<hanako<<endl;
	return 0;
}
	
	