n=int(input()) score=0 for i in range(n): a,b=map(int, input().split()) if a > b: score += 3 elif a == b: score += 1 print(score)