#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_9_C
n = gets.to_i

taro = 0
hanako = 0
n.times.each do
    t,h = gets.split
    taro += 3 if t > h
    hanako += 3 if h > t
    taro += 1 if h == t
    hanako += 1 if h == t
end

puts [taro,hanako].join(" ")