The classic programming language of Bitland is Bit++. This language is so peculiar and complicated.

The language is that peculiar as it has exactly one variable, called x. Also, there are two operations:

  Operation ++ increases the value of variable x by 1.  Operation -- decreases the value of variable x by 1. 

A statement in language Bit++ is a sequence, consisting of exactly one operation and one variable x. The statement is written without spaces, that is, it can only contain characters "+", "-", "X". Executing a statement means applying the operation it contains.

A programme in Bit++ is a sequence of statements, each of them needs to be executed. Executing a programme means executing all the statements it contains.

You're given a programme in language Bit++. The initial value of x is 0. Execute the programme and find its final value (the value of the variable when this programme is executed).


-----Input-----

The first line contains a single integer n (1 ≤ n ≤ 150) — the number of statements in the programme.

Next n lines contain a statement each. Each statement contains exactly one operation (++ or --) and exactly one variable x (denoted as letter «X»). Thus, there are no empty statements. The operation and the variable can be written in any order.


-----Output-----

Print a single integer — the final value of x.


-----Examples-----
Input
1
++X

Output
1

Input
2
X++
--X

Output
0

Difficulty: interview

Starter code:

Solutions:
str = input()
inpt = ""
n = int(str)
x = 0
for i in range(n):
	inpt = input()
	#print(inpt[0:2]+" - "+inpt[1:3])
	if(inpt[0:2] == "++" or inpt[1:3] == "++"):
		x += 1
		#print("x = {} plus 1".format(x))
	elif(inpt[0:2] == "--" or inpt[1:3] == "--"):
		x -= 1
		#print("x = {} minus 1".format(x))
print(x)

line = int(input())
x = 0

for i in range(0, line):
	a = input()
	
	if '+' in a:
		x += 1
		
	elif '-' in a:
		x -= 1
		
print(x)

s = 0
for i in range(int(input())):
  s += input()[1]=='+' or -1
print(s)

n = int( input().split()[0] )
x = 0
for i in range( 0, n ):
	s = input().split()[0]
	if s[1] == '+':
		x += 1
	else:
		x -= 1
print( x )

n=input()
n=int(n)
x=0
for i in range(n):
    s=input()
    if('+' in s):
        x+=1
    else:
        x-=1
print(x)


count = int(input())
x = 0
for i in range(0,count):
    raw = input()
    if '--' in raw:
        x -= 1
    else:
        x += 1 
print(x)

n = int(input())
x = 0
for i in range(n):
    if input()[1] == '+': x += 1
    else: x -= 1
print(x)


n = int(input())
x = 0

for i in range(n):
    if input().count('+')>0:
        x+=1
    else:
        x-=1

print(x)

import sys
inp = sys.stdin
n = int(inp.readline())
x = 0
for i in range(n):
  s = inp.readline()
  if "-" in s:
    x -= 1
  else:
    x += 1
print(x)    

n=int(input())
ans=0
for i in range(n):
	s=input()
	if s=="++X" or s=="X++":
		ans+=1
	else:
		ans-=1
print(ans)

# http://codeforces.com/problemset/problem/282/A

n = int(input()) #steven
x = 0 #how to for loop
for i in range(n): #steven, look at input()[1]?
    s = input() #can i do this?
    if s[1] == '+': #prolly
        x += 1 #scott
    else: x -= 1 # i don't think so. bad style
print (x) #scott ok bro

#yoloswag


# http://codeforces.com/problemset/problem/282/A

n = int(input()) #steven
x = 0 #how to for loop
for i in range(n): #steven, look at input()[1]?
    s = input() #can i do this?
    if s[1] == '+': #prolly
        x += 1 #scott
    else: x -= 1 # i don't think so. bad style
print (x) #scott ok bro

#yoloswag


import sys

n = int(input())
i = 0
res = 0
while (i < n):
    s = input()
    if (s[1] == '+'):
        res = res + 1
    else:
        res = res - 1
    i = i + 1
print(res)
    



def main():
    
    n=int(input())
    sum=0
    for i in range(n):
        cad=input()
        if cad == "X++" or cad=="++X":
            sum+=1
        else :
            sum-=1
    
    print(sum)
def __starting_point():
    main()             

__starting_point()

n = int(input())
x = 0
for i in range(n):
	S = input()
	if (S.count('++')):
		x += 1
	else:
		x -= 1
print (x)

n = int( input() )
r = 0;
for i in range(0, n):
    str = input()
    if str[1] == "+":
        r += 1
    else:
        r -= 1

print(r)


n,X=input(),0
for t in range(int(n)):
    X+=[-1,1][input()[1]=='+']
print(X)

import sys, itertools

count = int(next(sys.stdin))
x = 0
for line in itertools.islice(sys.stdin, count):
    x += 1 if '++' in line else -1
print(x)



n=int(input())
a=0
for i in range(0,n) :
    q=input()
    if "+" in q :
        a=a+1
    else :
        a=a-1
print(a)


n = int(input())

s = 0
for _ in range(n):
	s += 1 if input()[1] == '+' else -1
	
print(s)

c=int(input())
x=0
for i in range(c):
    s=input()
    if(s.count('++')):
        x=x+1
    else:
        x=x-1
print(x)


n = int(input())
S = 0
while n > 0:
    str = input()
    if str[1] == '+':
        S += 1
    else:
        S -= 1
    n -= 1

print (S)

n = int(input())
x = 0
for i in range(n):
    line = input()
    if line == '++X' or line == 'X++':
        x += 1
    else:
        x -= 1
print(x)


n = int(input())
x = 0

for i in range(n):
    t = input()
    if t[0] != 'X':
        x += t[0] == '+'
    else:
        x += t[2] == '+'
print(2 * x - n)



n = int(input())
x = 0

for i in range(n):
    t = input()
    if t[1] == '+':
        x += 1
print(2 * x - n)