accum = lambda n: n*(n+1)/2 x1,y1,x2,y2,d = map(int,raw_input().split()) if x1 < 0 < x2: x = [(1,-x1),(0,x2)] elif x2 <= 0: x = [(-x2,-x1)] else: x = [(x1,x2)] if y1 < 0 < y2: y = [(1,-y1),(0,y2)] elif y2 <= 0: y = [(-y2,-y1)] else: y = [(y1,y2)] ans = 0 for x1,x2 in x: for y1,y2 in y: if x1 + y1 > d: continue if x2 + y2 <= d: ans += (x2-x1+1)*(y2-y1+1); continue if x2 + y1 >= d: bx = d - y1 if x1 + y2 >= d: ans += accum(bx-x1+1) else: ux = d - y2; delta = y2-y1+1 ans += accum(delta) + delta * (ux-x1) else: ry = d - x2 if x1 + y2 >= d: delta = x2-x1+1 ans += accum(delta) + delta * (ry-y1) else: ux = d - y2 ans += (x2-x1+1)*(y2-y1+1) - (x2 - ux)*(y2 - ry) print ans