CSES - Forest Queries
  • Time limit: 1.00 s
  • Memory limit: 512 MB

You are given an n×nn \times n grid representing the map of a forest. Each square is either empty or contains a tree. The upper-left square has coordinates (1,1)(1,1), and the lower-right square has coordinates (n,n)(n,n).

Your task is to process qq queries of the form: how many trees are inside a given rectangle in the forest?

Input

The first input line has two integers nn and qq: the size of the forest and the number of queries.

Then, there are nn lines describing the forest. Each line has nn characters: . is an empty square and * is a tree.

Finally, there are qq lines describing the queries. Each line has four integers y1y_1, x1x_1, y2y_2, x2x_2 corresponding to the corners of a rectangle.

Output

Print the number of trees inside each rectangle.

Constraints

  • 1n10001 \le n \le 1000
  • 1q21051 \le q \le 2 \cdot 10^5
  • 1y1y2n1 \le y_1 \le y_2 \le n
  • 1x1x2n1 \le x_1 \le x_2 \le n

Example

Input:

4 3
.*..
*.**
**..
****
2 2 3 4
3 1 3 1
1 1 2 2

Output:

3
1
2