S=eval(input())

#N=int(input())

#A1,A2,A3=map(int,input().split())

sum=0

for i in S:

    if i=="+":

        sum+=1

    else:

        sum-=1

print(sum)
S=eval(input())

ans=0

for i in S:

    if i=="+":

        ans+=1

    else:

        ans-=1

print(ans)

S = eval(input())
# N=int(input())
# A1,A2,A3=map(int,input().split())
sum = 0
for i in S:
    if i == "+":
        sum += 1
    else:
        sum -= 1
print(sum)

S = eval(input())
ans = 0
for i in S:
    if i == "+":
        ans += 1
    else:
        ans -= 1
print(ans)

-# N=int(input()) -# A1,A2,A3=map(int,input().split()) -sum = 0 +ans = 0 -        sum += 1 +        ans += 1 -        sum -= 1 -print(sum) +        ans -= 1 +print(ans)