P27307 [AtCoder] Calculation of Remainder When Divided by 11
提高-
题目描述

Problem Description

The remainder when an integer $ M $ is divided by $ 11 $ is the same as the remainder when the sum of the digits in the odd positions from the end of $ M $ minus the sum of the digits in the even positions from the end of $ M $ is divided by $ 11 $.

Given an integer $ N $. Output the remainder when $ N $ is divided by $ 11 $.

Input Format

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

$ N $

Output Format

Output the remainder when $ N $ is divided by $ 11 $.

Sample Input and Output

Sample Input #1

123456

Sample Output #1

3

Sample Input #2

90909

Sample Output #2

5

Notes/Hints

Constraints

  • $ 1 ≦ N ≦ 10^9 $

Sample Explanation 1

$ (2 + 4 + 6) - (1 + 3 + 5) = 3 $.

Sample Explanation 2

$ (9 + 9 + 9) - (0 + 0) = 27 $, and the remainder when this is divided by $ 11 $ is $ 5 $.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
123456
样例输出
3