#abc101a. A - Eating Symbols Easy

A - Eating Symbols Easy

Score : 100100 points

问题描述

Takahashi 的心中始终有一个整数。

最初,Takahashi 心中的整数为 00。现在他将要吃掉四个符号,每个符号是 +-。当他吃掉 + 时,他心中的整数增加 11;当他吃掉 - 时,他心中的整数减少 11

作为字符串 SS 给定的符号是 Takahashi 将要吃掉的。SS 中的第 ii 个字符即为他要吃掉的第 ii 个符号。

请你找出 Takahashi 吃掉所有符号后,他心中的整数是多少。

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

There is always an integer in Takahashi's mind.

Initially, the integer in Takahashi's mind is 00. Takahashi is now going to eat four symbols, each of which is + or -. When he eats +, the integer in his mind increases by 11; when he eats -, the integer in his mind decreases by 11.

The symbols Takahashi is going to eat are given to you as a string SS. The ii-th character in SS is the ii-th symbol for him to eat.

Find the integer in Takahashi's mind after he eats all the symbols.

Constraints

  • The length of SS is 44.
  • Each character in SS is + or -.

Input

Input is given from Standard Input in the following format:

SS

Output

Print the integer in Takahashi's mind after he eats all the symbols.

Sample Input 1

+-++

Sample Output 1

2
  • Initially, the integer in Takahashi's mind is 00.
  • The first integer for him to eat is +. After eating it, the integer in his mind becomes 11.
  • The second integer to eat is -. After eating it, the integer in his mind becomes 00.
  • The third integer to eat is +. After eating it, the integer in his mind becomes 11.
  • The fourth integer to eat is +. After eating it, the integer in his mind becomes 22.

Thus, the integer in Takahashi's mind after he eats all the symbols is 22.

Sample Input 2

-+--

Sample Output 2

-2

Sample Input 3

----

Sample Output 3

-4

update @ 2024/3/10 17:17:18