<reponame>bartekpacia/python-training<filename>codeforces/282A.py
n = int(input())

x = 0
for i in range(n):
    line = input()
    if "++" in line:
        x += 1
    elif "--" in line:
        x -= 1

print(x)

n = int(input())

x = 0
for i in range(n):
    line = input()
    if "++" in line:
        x += 1
    elif "--" in line:
        x -= 1

print(x)