Takahashi has an integer in his mind, which starts at 0. He will consume four symbols, each of which can be either + or -.
When he consumes +, the integer in his mind increases by 1.
When he consumes -, the integer in his mind decreases by 1.
You are given a string S that represents the symbols Takahashi will consume, where each character in the string is either + or -. Your task is to determine the final value of the integer in Takahashi's mind after he consumes all the symbols.
Input Format
A string S of length 4, consisting of the characters + and -.
Output Format
An integer representing the final value of Takahashi's integer after consuming all the symbols.
Constraints
The length of the string S will always be 4.
Examples
Example 1
Input:
text
S = "++--"
Output:
text
0
Example 2
Input:
text
S = "+-++"
Output:
text
2
Example 3
Input:
text
S = "----"
Output:
text
-4
Example 4
Input:
text
S = "++++"
Output:
text
4
Solution
Please place your solution in the /app/ directory.
Important: place your implementation at /app/solution.py so the verifier can run it.