n = gets.chomp.to_i
p_t, p_h = 0,0
for i in 1..n do
  s_t,s_h = gets.chomp.split(" ")
  if s_t > s_h
    p_t += 3
  elsif s_t < s_h
    p_h += 3
  else
    p_t += 1
    p_h += 1
  end
end
printf("%d %d\n",p_t,p_h)
