a = []
hanako = 0
taro = 0

n.times do
    a << gets.split.map(&:to_s)
end

for i in 0...n do
    if (a[i][0] == a[i][1]) then
        hanako += 1
        taro += 1
    elsif (a[i][0] > a[i][1]) then
        hanako += 3
    elsif (a[i][0] < a[i][1]) then
        taro += 3
    end
end

puts "#{hanako} #{taro}"