#0004C6

O-Squares

You are given big chess table with dark and white areas. Areas are KxK simple squares (1x1). Bottom left area is dark colored.


Calculate number of dark colored simple squares in rectangular area determined with its bottom left (Xdl, Ydl) and upper right (Xur,Yur) simple square.


InputIn first line of input is integer K. (K <= 1000000) area dimension of chess board.
In second line of input are four integers Xdl, Ydl) , Xur,Yur representing rectangle for counting darks. (1 <= Xdl <= Xgd <= 1000000, 1 <= Ydl <= Ygd <=1000000)

OutputIn first line of output print number of simple dark colored squares in given rectangular area.


Input:
4
3 3 7 6

Output:
10



Input:
1
26 44 57 63

Output:
320


Image: slika

Image explain first example. Blue colored squares is one that you need to count.


In 20% tests K = 1.
In 50% tests Xgd, Ygd <= 4000.


Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.