#include <iostream>
using namespace std;

int main(){
	int n, m1 = 0, m2 = 0;
	string s1, s2;
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> s1 >> s2;
		if (s1 > s2)
			m1 +=3;
		else if (s2 > s1){
			m2 += 3;
		}
		else {
			m1++;
			m2++;
		}
	}
	cout << m1 << ' ' << m2 << '\n';
}
