def sumn(n): return n*(n+1)/2 x1,y1,x2,y2,d=map(int,raw_input().split()) if x1>=0: xx=[[x1,x2]] elif x2<=0:xx=[[-x2,-x1]] else:xx=[[1,-x1],[0,x2]] if y1>=0: yy=[[y1,y2]] elif y2<=0:yy=[[-y2,-y1]] else:yy=[[1,-y1],[0,y2]] ans=0 for x in xx: for y in yy: if x[0]+y[0]>d:continue if x[1]+y[1]<=d: ans+=(x[1]-x[0]+1)*(y[1]-y[0]+1) continue if x[1]+y[0] >= d: if x[0]+y[1]>=d: tx=d-y[0] ans+=sumn(tx-x[0]+1) else: tx=d-y[1] e=y[1]-y[0]+1 ans+=sumn(e)+e*(tx-x[0]) else: if x[0]+y[1]>=d: ty=d-x[1] e=x[1]-x[0]+1 ans+=sumn(e)+e*(ty-y[0]) else: tx=d-y[1] ans+=(x[1]-x[0]+1)*(y[1]-y[0]+1)-sumn(x[1]-tx) print ans