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

int main(){
	string st, sh;
	int n;
	int t = 0;
	int h = 0;
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> st >> sh;
		if (st < sh) h += 3;
		if (st > sh) t += 3;
		if (st == sh) (h += 1, t += 1);
	}
	cout << t << " " << h << endl;
}
