taro = hanako = 0
gets.to_i.times do
    card = gets.split
    if card[0] < card[1]
        hanako += 3
    elsif card[0] == card[1]
        taro += 1;hanako += 1
    else
        taro += 3
    end
end
puts "#{taro} #{hanako}"
