Balanced numbers

Balanced Numbers

Description

A balanced number is a 3-digit number whose second digit is equal to the sum of the first and last digit.

Write a program which reads and sums balanced numbers. You should stop when an unbalanced number is given.

Input

Input data is read from the standard input (the console)

  • Numbers will be given
    • Each one will be on a separate line

Output

Print to the standard output

  • Print the sum of the balanced numbers

Constraints

  • No more than 1000 numbers will be given

Sample tests

Sample test 1

Input

132
123

Output

132

Sample test 2

Input

275
693
110
742

Output

1078