t = int(input())
count = 0
count2 = 0
for _ in range(t):
a,b = input().split()
if(a>b):
count +=3
elif(a == b):
count +=1
count2 +=1
else:
count2 +=3
print(count,count2)
dCA9IGludChpbnB1dCgpKQpjb3VudCA9IDAKY291bnQyID0gMApmb3IgXyBpbiByYW5nZSh0KToKCWEsYiA9IGlucHV0KCkuc3BsaXQoKQoJCglpZihhPmIpOgoJCWNvdW50ICs9MwoJZWxpZihhID09IGIpOgoJCWNvdW50ICs9MQoJCWNvdW50MiArPTEKCWVsc2U6CgkJY291bnQyICs9MwoJCQpwcmludChjb3VudCxjb3VudDIp