n = gets.to_i
taro, hana = 0, 0
n.times do
    w1, w2 = gets.split(/ /)
    if w1 > w2
        taro += 3
    elsif w1 < w2
        hana += 3
    else
        taro += 1
        hana += 1
    end
end

print taro, " ", hana, "\n"
__END__
Sample Input
3
cat dog
fish fish
lion tiger
Sample Output
1 7