시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 512 MB 15 11 11 91.667%

문제

Emilian is a very smart boy who loves palindromes. Radu knows this fact so he gifted his friend a set of n integers, some being palindromes and other not. Emilian was very happy so he asked himself more questions and he will apriciate if you help him answering one of them. What is the sum of all palindrome integers from the set received from Radu?

Given a set of n integers calculate the sum of the palindrome integers.

입력

The first line contains the integer n and the second line contains n integers.

출력

The first line contains only one integer representing the sum of all palindrome integers.

제한

  • 1 ≤ n ≤ 1,000,000
  • All integers from the set are less than 1,000,000,000

예제 입력 1

5
1 13 22 121 45

예제 출력 1

144