Degree of symmetry#558

Degree of symmetry

1 second
64 megabytes
Very easy (≈850)
prb19

For a natural number let's define the degree of symmetry as an amount of pairs of its decimal digits, whose digits are equal and stand symmetrically with respect to the center of the number's decimal notation. If some digit stands in the center of the decimal notation, then it must be accepted too, as in pair with itself. Find the degree of symmetry of a given number n.

Input

The natural number n (n < 2 ·10^9).

Output

Print the degree of symmetry of n.

Examples

Example 1

Loading
Loading