100 atcoder#ABC101A. [ABC101A] Eating Symbols Easy
[ABC101A] Eating Symbols Easy
Score : points
Problem Statement
There is always an integer in Takahashi's mind.
Initially, the integer in Takahashi's mind is . Takahashi is now going to eat four symbols, each of which is +
or -
. When he eats +
, the integer in his mind increases by ; when he eats -
, the integer in his mind decreases by .
The symbols Takahashi is going to eat are given to you as a string . The -th character in is the -th symbol for him to eat.
Find the integer in Takahashi's mind after he eats all the symbols.
Constraints
- The length of is .
- Each character in is
+
or-
.
Input
Input is given from Standard Input in the following format:
Output
Print the integer in Takahashi's mind after he eats all the symbols.
+-++
2
- Initially, the integer in Takahashi's mind is .
- The first integer for him to eat is
+
. After eating it, the integer in his mind becomes . - The second integer to eat is
-
. After eating it, the integer in his mind becomes . - The third integer to eat is
+
. After eating it, the integer in his mind becomes . - The fourth integer to eat is
+
. After eating it, the integer in his mind becomes .
Thus, the integer in Takahashi's mind after he eats all the symbols is .
-+--
-2
----
-4