Class

No attempts yetTime limit1sMemory limit1024 MB

Problem

A classroom is full of students seated in rows and columns. Each student is interested to some degree in computers and in sports. A student interested only in sports is labeled $0$. A student interested only in computers is labeled $9$. Every other student is labeled with a digit from $1$ to $8$ according to their level of interest.

Students with similar interests chat with one another and ignore the teacher. The smaller the difference between two neighboring students' interests, the more they chat. For example, a student with interest $7$ surrounded by other students who also have interest $7$ pays no attention to the teacher at all.

Each student's attention is defined as the average of the absolute differences between their own interest and the interests of their neighbors. Neighbors are the students seated directly in front of, behind, to the left of, or to the right of a given student.

The total attention of the class equals the sum of the individual students' attention values. Write a program that computes it.

Input

The first line contains two integers $M$ and $N$ ($1 \le M \le 200$, $1 \le N \le 200$), the number of rows and columns in the classroom. The classroom has at least two students. Each of the next $M$ lines contains exactly $N$ characters, each a digit from $0$ to $9$.

Output

Print a single number: the total attention of the class, with exactly four digits after the decimal point.