x1, y1, x2, y2, d = map(int, input().split())


def solve(x1, y1, x2, y2, d):
    x1, y1, x2, y2 = relocate(x1, y1, x2, y2)
    if x1 < x2 or x1 < 0 or y1 < 0 or y1 < y2:
        raise RuntimeError('relocate failed. x1:{}, y1:{}, x2:{}, y2:{}'.format(x1, y1, x2, y2))
    if x2 > 0:
        if y2 > 0:
            return f(x1, y1) - f(x2 - 1, y1) - f(x1, y2 - 1) + f(x2 - 1, y2 - 1)
        elif y2 == 0:
            return f(x1, y1) - f(x2 - 1, y1)
        else:
            return f(x1, y1) - f(x2 - 1, y1) + f(x1, -y2) - f(x2 - 1, -y2) - min(x1, d) + min(x2 - 1, d)
    elif x2 == 0:
        if y2 > 0:
            return f(x1, y1) - f(x1, y2 - 1)
        elif y2 == 0:
            return f(x1, y1)
        else:
            return f(x1, y1) + f(x1, -y2) - min(x1, d) - 1
    else:
        if y2 > 0:
            xx1 = max(y1, y2)
            yy1 = max(x1, x2)
            xx2 = min(y1, y2)
            yy2 = min(x1, x2)
            return f(xx1, yy1) - f(xx2 - 1, yy1) + f(xx1, -yy2) - f(xx2 - 1, -yy2) - min(xx1, d) + min(xx2 - 1, d)
        elif y2 == 0:
            return f(x1, y1) + f(-x2, y1) - min(y1, d) - 1
        else:
            total = f(x1, y1) + f(-x2, -y2) + f(x1, -y2) + f(-x2, y1)
            vertical_double_counts = min(y1, d) - max(y2 - 1, - d - 1)
            horizontal_double_counts = min(x1, d) - max(x2 - 1, - d - 1)
            return total - vertical_double_counts - horizontal_double_counts - 1
            

def relocate(x1, y1, x2, y2):
    if x2 > 0:
        if y2 > 0:
            return x2, y2, x1, y1
        else:
            return x2, -y1, x1, -y2        
    else:
        if y2 > 0:
            return -x1, y2, -x2, y1
        else:
            return -x1, -y1, -x2, -y2

def f(x, y):
    if x < 0 or y < 0:
        raise RuntimeError('x and y must be non-negative. x:{}, y:{}'.format(x, y))
    if x + y <= d:
        return (x + 1) * (y + 1)
    ydif = max(0, d - y)
    xdif = max(0, d - x)
    return area(d + 1) - area(ydif) - area(xdif)
        
def area(size):
    return size * (size + 1) // 2    

print(solve(x1, y1, x2, y2, d))