P26338 [AtCoder] Mental Calculation Game
入门
题目描述

Problem Description

Takahashi loves mental calculations with single-digit numbers. He practices mental calculations using a sequence of numbers.

Takahashi repeats the calculation by adding the numbers represented by the digits at odd positions and subtracting the numbers represented by the digits at even positions.

For example, given the sequence 13458, he calculates $ 1 - 3 + 4 - 5 + 8 $.

Please create a program that outputs the result of this calculation for Takahashi.

Input Format

The input is given from the standard input in the following format:

$ S $

  • The first line contains the sequence of numbers $S\ (1 ≦ |S| ≦ 1000)$ that Takahashi uses for his calculation.
  • It is guaranteed that the characters in $ S $ are digits from 0 to 9.

Output Format

Output the result of the calculation specified in the problem statement in one line. Ensure to include a newline at the end of the output.

Sample Input and Output

Sample Input #1

13458

Sample Output #1

5

Sample Input #2

2525

Sample Output #2

-6

Notes/Hints

Sample Explanation 1

Calculating $ 1 - 3 + 4 - 5 + 8 $ results in $ 5 $.

Sample Explanation 2

Note that the output can be a negative number.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
13458
样例输出
5