n = gets.chomp.to_i
taro = 0
hanako = 0
while line = gets
  t, h = line.chomp.split(' ')
  if t > h
    taro += 3
  elsif t < h
    hanako += 3
  elsif t == h
    taro += 1
    hanako += 1
  end
end
print "#{taro} #{hanako}\n"