Codeforces Round 173 (Div. 2)
A
Bit++
Codeforces
800
原题
←B →
翻译中…

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*$.

翻译中…

样例

Input #1
1
++X
Output #1
1
InputCopy OutputCopy
Input #2
2
X++
--X
Output #2
0
InputCopy OutputCopy
题目信息
题号
282A
时间限制
1 s
内存限制
256 MB
标签
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。