scores = Array.new(2, 0)
gets.to_i.times do
  taro, hanako = gets.chomp.split(' ')
  if taro == hanako
    scores.map! {|s| s += 1}
  elsif taro > hanako
    scores[0] += 3
  else
    scores[1] += 3
  end
end
puts scores.join(' ')
