def main():
    t = int(input())
    while t > 0 and t <= 20:
        votes = int(input())
        d = {}
        for i in range(votes):
            voteValue = input().split()
            d[voteValue[0]] = voteValue[1]
        count = 0
        for value in d:
            if d[value] == '+':
                count += 1
            else:
                count -= 1
        print(count)
        t -= 1


if __name__ == '__main__':
    main()

7cae2cbdc4279bf71e1a59e7bed35988233fc3cd
<mask token>

def main():
    t = int(input())
    while t > 0 and t <= 20:
        votes = int(input())
        d = {}
        for i in range(votes):
            voteValue = input().split()
            d[voteValue[0]] = voteValue[1]
        count = 0
        for value in d:
            if d[value] == '+':
                count += 1
            else:
                count -= 1
        print(count)
        t -= 1


<mask token>

def main():
    t = int(input())
    while t > 0 and t <= 20:
        votes = int(input())
        d = {}
        for i in range(votes):
            voteValue = input().split()
            d[voteValue[0]] = voteValue[1]
        count = 0
        for value in d:
            if d[value] == '+':
                count += 1
            else:
                count -= 1
        print(count)
        t -= 1


if __name__ == '__main__':
    main()
