import std.stdio, std.string;
void main() {
	readln;
	int a, b = 0;
	foreach (string l; lines(stdin)) {
		string[] d = l.split;
		if (d[0] > d[1]) a += 3;
		else if (d[1] > d[0]) b += 3;
		else {
			a++;
			b++;
		}
	}
	"%d %d".writefln(a, b);
}