#!/usr/bin/env ruby

if __FILE__ == $0 then
    point = [0]*2
    n = gets.chomp.to_i

	n.times do
        t, h = gets.split
        if t == h then
			point.map!{ |x| x+1 }
		else
            point[t<h ? 1 : 0] += 3
		end
	end
	puts '%d %d' % point
end
