import std.stdio, std.string, std.array, std.conv;

void main() {
    int n = readln.chomp.to!int;
    int[] point = new int[2];
    foreach (i; 0 .. n) {
        string[] tmp = readln.chomp.split;
        if (tmp[0] == tmp[1]) {
            point[] += 1;
        } else if (tmp[0] < tmp[1]) {
            point[1] += 3;
        } else {
            point[0] += 3;
        }
    }
    writeln(point[0], " ", point[1]);
}
