fork download
  1. t = int(input())
  2. count = 0
  3. count2 = 0
  4. for _ in range(t):
  5. a,b = input().split()
  6.  
  7. if(a>b):
  8. count +=3
  9. elif(a == b):
  10. count +=1
  11. count2 +=1
  12. else:
  13. count2 +=3
  14.  
  15. print(count,count2)
Success #stdin #stdout 0.04s 9772KB
stdin
3
cat dog
fish fish
lion tiger
stdout
1 7