n=int(eval(input()))

h=int(eval(input()))

w=int(eval(input()))

print(((n-h+1)*(n-w+1)))
n=int(eval(input()))

print(((n-int(eval(input()))+1)*(n-int(eval(input()))+1)))
n = int(eval(input()))
h = int(eval(input()))
w = int(eval(input()))
print(((n - h + 1) * (n - w + 1)))

n = int(eval(input()))
print(((n - int(eval(input())) + 1) * (n - int(eval(input())) + 1)))

-h = int(eval(input())) -w = int(eval(input())) -print(((n - h + 1) * (n - w + 1))) +print(((n - int(eval(input())) + 1) * (n - int(eval(input())) + 1)))