n = gets.to_i
taro = 0
hanako = 0
n.times do |i|
  tc, hc = gets.split(" ")
  case (tc <=> hc)
  when -1
    hanako += 3
  when 0
    taro += 1
    hanako += 1
  when 1
    taro += 3
  end
  puts [taro, hanako].join(" ") if (i == (n-1))
end