#include #define Add(x,y) (x+y>=mod)?(x+y-mod):(x+y) #define lowbit(x) x&(-x) #define pi pair #define pii pair> #define iip pair,ll> #define ppii pair,pair> #define fi first #define se second #define full(l,r,x) for(auto it=l;it!=r;it++) (*it)=x #define Full(a) memset(a,0,sizeof(a)) #define open(s1,s2) freopen(s1,"r",stdin),freopen(s2,"w",stdout); using namespace std; typedef double db; typedef unsigned long long ull; typedef long long ll; bool Begin; inline ll read(){ ll x=0,f=1; char c=getchar(); while(c<'0'||c>'9'){ if(c=='-') f=-1; c=getchar(); } while(c>='0'&&c<='9'){ x=(x<<1)+(x<<3)+(c^48); c=getchar(); } return x*f; } inline void write(ll x){ if(x<0){ putchar('-'); x=-x; } if(x>9) write(x/10); putchar(x%10+'0'); } bool End; ll X1,Y1,X2,Y2,D; ll get(ll X,ll Y,ll D){ if(X=X+Y) return (X+1)*(Y+1); if(D>=X) return (X+1)*(Y+1)-(X+Y-D)*(X+Y-D+1)/2; if(D>=Y) return Y*(Y+1)/2+(Y+1)*(D-Y+1); return (D+1)*(D+2)/2; } ll solve(ll X1,ll Y1,ll X2,ll Y2,ll D){ ll ans=0; if(X1>X2) swap(X1,X2); if(Y1>Y2) swap(Y1,Y2); if(X1<0&&X2>0) return solve(1,Y1,-X1,Y2,D)+solve(0,Y1,X2,Y2,D); if(Y1<0&&Y2>0) return solve(X1,1,X2,-Y1,D)+solve(X1,0,X2,Y2,D); if(X1<0) return solve(-X2,Y1,-X1,Y2,D); if(Y1<0) return solve(X1,-Y2,X2,-Y1,D); ans+=get(X2,Y2,D); if(X1) ans-=get(X1-1,Y2,D); if(Y1) ans-=get(X2,Y1-1,D); if(X1&&Y1) ans+=get(X1-1,Y1-1,D); return ans; } int main(){ // open("manhattan.in","manhattan.out"); X1=read(),Y1=read(),X2=read(),Y2=read(),D=read(); write(solve(X1,Y1,X2,Y2,D)); return 0; }