Photography
Every morning at , students at LKS gather for a workout in front of the main building. The boys and girls line up on the asphalt, forming a rectangle.
On the building's steps stands a photographer. He wants to take a group photo of some of the boys and girls. To do this, he needs to select a rectangular area on the asphalt such that the number of boys and girls inside the area is equal. Unfortunately for the LKS students, there are many such areas. The photographer wants to take photos of all possible areas to choose the best one. Each photo takes one second to capture, and during this time, the boys and girls will continue their workout!
Imagine that there is a coordinate system drawn on the asphalt in front of the building. The students stand at integer points, forming a rectangle of size with sides parallel to the coordinate axes. The photographer needs to select a subrectangle with sides parallel to the coordinate axes.
Write a program that calculates how many seconds the students will be doing their workout.
Input
The first line contains two positive integers and — the dimensions of the rectangle formed by the students. Each of the following lines contains numbers. The number indicates that a boy is at that position, and the number indicates that a girl is at that position.
Output
Print the number of seconds the students will be working out.