Time limit: 0.5s
Memory limit: 64MB
Input:
Output:
Emilian is a very smart boy who loves palindromes. Radu knows this fact so he gifted his friend a set of integers, some being palindromes and other not. Emilian was very happy so he asked himself more questions and he will apreciate if you help him answering one of them. What is the sum of all palindrome integers from the set received from Radu?
Task
Given a set of integers calculate the sum of the palindrome integers.
Input
The first line contains the integer and the second line contains integers.
Output
The first line contains only one integer representing the sum of all palindrome integers.
Restrictions
- All integers from the set are less than
# | Points | Restrictions |
---|---|---|
1 | 15 | All integers from the set are palindromes |
2 | 20 | All integers from the set are |
3 | 30 | All integers from the set are |
4 | 35 | Normal restrictions |
Example
stdin
5
1 13 22 121 45
stdout
144