Reminder: in case of any technical issues, you can use the lightweight website
m1.codeforces.com,
m2.codeforces.com,
m3.codeforces.com.
×

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

A. Vanya and Table

time limit per test

2 secondsmemory limit per test

256 megabytesinput

standard inputoutput

standard outputVanya has a table consisting of 100 rows, each row contains 100 cells. The rows are numbered by integers from 1 to 100 from bottom to top, the columns are numbered from 1 to 100 from left to right.

In this table, Vanya chose *n* rectangles with sides that go along borders of squares (some rectangles probably occur multiple times). After that for each cell of the table he counted the number of rectangles it belongs to and wrote this number into it. Now he wants to find the sum of values in all cells of the table and as the table is too large, he asks you to help him find the result.

Input

The first line contains integer *n* (1 ≤ *n* ≤ 100) — the number of rectangles.

Each of the following *n* lines contains four integers *x*_{1}, *y*_{1}, *x*_{2}, *y*_{2} (1 ≤ *x*_{1} ≤ *x*_{2} ≤ 100, 1 ≤ *y*_{1} ≤ *y*_{2} ≤ 100), where *x*_{1} and *y*_{1} are the number of the column and row of the lower left cell and *x*_{2} and *y*_{2} are the number of the column and row of the upper right cell of a rectangle.

Output

In a single line print the sum of all values in the cells of the table.

Examples

Input

2

1 1 2 3

2 2 3 3

Output

10

Input

2

1 1 3 3

1 1 3 3

Output

18

Note

Note to the first sample test:

Values of the table in the first three rows and columns will be as follows:

121

121

110

So, the sum of values will be equal to 10.

Note to the second sample test:

Values of the table in the first three rows and columns will be as follows:

222

222

222

So, the sum of values will be equal to 18.

Codeforces (c) Copyright 2010-2020 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Apr/08/2020 18:21:49 (f3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|