  taro,hana=0,0
  ($stdin.gets.to_i).times do
    iT,iH=$stdin.gets.split
    case iT<=>iH
    when -1; hana+=3
    when 0; (taro+=1;hana+=1)
    when 1; taro+=3
    end
  end
  puts [taro,hana].join " "
