#pragma GCC diagnostic error "-std=c++11"
#pragma GCC target("avx")
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-fstrict-overflow")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-skip-blocks")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
#include<bits/stdc++.h>
#define N 200010
#define ll unsigned long long
#define pp pair<int,int>
using namespace std;
vector<int>q[N];
int n,m,a[N],b[N],degree[N];
ll A,B,C,ans;
map<pp,int>Map;
int main() {
	scanf("%d%d",&n,&m);
	scanf("%lld%lld%lld",&A,&B,&C);
	for(int i=1; i<=m; i++) {
		scanf("%d%d",&a[i],&b[i]);
		if(a[i]>b[i])swap(a[i],b[i]);
		q[a[i]].push_back(b[i]),q[b[i]].push_back(a[i]);
		degree[a[i]]++,degree[b[i]]++;
		Map[pp(a[i],b[i])]=Map[pp(b[i],a[i])]=1;
	}
	for(int i=0; i<n; i++) {
		ans+=(ll)i*A*((ll)(n-i-1)*(n-i-2)/2LL);
		ans+=(ll)i*B*((ll)(i)*(n-i-1));
		ans+=(ll)i*C*((ll)(i)*(i-1)/2LL);
	}

	for(int i=1; i<=m; i++) {
		a[i],b[i];
		ans-=(ll)a[i]*a[i]*B+(ll)a[i]*b[i]*C+(ll)a[i]*(a[i]-1)/2LL*A;
		ans-=(ll)(b[i]-a[i]-1)*a[i]*A+(ll)(b[i]-a[i]-1)*b[i]*C+(ll)(b[i]-a[i]-1)*(a[i]+b[i])/2LL*B;
		ans-=(ll)(n-b[i]-1)*a[i]*A+(ll)(n-b[i]-1)*b[i]*B+(ll)(n-b[i]-1)*(n+b[i])/2LL*C;
	}

//	cout<<ans<<endl;
	for(int i=0; i<n; i++)sort(q[i].begin(),q[i].end());
	for(int i=0; i<n; i++) {
		ll pre=0,pre_tot=0;
		for(int j=0; j<q[i].size(); j++) {
			int to=q[i][j];
			if(to>i)continue;
			ans+=pre_tot*i*C+pre*A+to*pre_tot*B;
			pre+=to;
			pre_tot++;
		}
		ll nex=0,nex_tot=0;
		for(int j=0; j<q[i].size(); j++) {
			int to=q[i][j];
			if(to<i)continue;
			ans+=nex_tot*i*A+nex*B+to*nex_tot*C;
			nex+=to;
			nex_tot++;
		}
		ans+=pre_tot*nex_tot*i*B+pre_tot*nex*C+nex_tot*pre*A;
	}

//	cout<<ans<<endl;
	for(int i=1; i<=m; i++) {
		int x=0;
		if(degree[a[i]]<degree[b[i]])x=a[i];
		else x=b[i];
		for(int j=0; j<q[x].size(); j++) {
			int to=q[x][j];
			if(Map[pp(a[i],to)]&&Map[pp(b[i],to)]&&to>a[i]&&to>b[i]){
				ans-=a[i]*A+b[i]*B+to*C;
			}
		}
	}
	printf("%llu\n",ans);
	return 0;
}


//test
#include <stdio.h>
#include <string.h>
#include <math.h>

#include <tr1/unordered_map>
#include <vector>
using namespace std;
using namespace std::tr1;

#define MAX_LINE 100005

typedef long long LL;

int D[MAX_LINE];

int n, m;

unordered_map<LL,int> st;

int main()
{
    return 0;
}


#include<bits/stdc++.h>
#define N 200010
#define ll unsigned long long
#define pp pair<int,int>
using namespace std;
vector<int>q[N],g[N];
int n,m,a[N],b[N];
ll A,B,C,ans;
ll calc(ll a,ll b,ll c){
	ll s[3]={a,b,c};
	sort(s,s+3);
	return a*A+b*B+c*C;
}
int main() {
	scanf("%d%d",&n,&m);
	scanf("%lld%lld%lld",&A,&B,&C);
	for(int i=1; i<=m; i++) {
		scanf("%d%d",&a[i],&b[i]);
		if(a[i]>b[i])swap(a[i],b[i]);
		q[a[i]].push_back(b[i]),q[b[i]].push_back(a[i]);
	}
	for(int i=0; i<n; i++) {
		ans+=(ll)i*A*((ll)(n-i-1)*(n-i-2)/2LL);
		ans+=(ll)i*B*((ll)(i)*(n-i-1));
		ans+=(ll)i*C*((ll)(i)*(i-1)/2LL);
	}

	for(int i=1; i<=m; i++) {
		ans-=(ll)a[i]*a[i]*B+(ll)a[i]*b[i]*C+(ll)a[i]*(a[i]-1)/2LL*A;
		ans-=(ll)(b[i]-a[i]-1)*a[i]*A+(ll)(b[i]-a[i]-1)*b[i]*C+(ll)(b[i]-a[i]-1)*(a[i]+b[i])/2LL*B;
		ans-=(ll)(n-b[i]-1)*a[i]*A+(ll)(n-b[i]-1)*b[i]*B+(ll)(n-b[i]-1)*(n+b[i])/2LL*C;
	}

//	cout<<ans<<endl;
	for(int i=0; i<n; i++)sort(q[i].begin(),q[i].end());
	for(int i=0; i<n; i++) {
		ll pre=0,pre_tot=0;
		for(int j=0; j<q[i].size(); j++) {
			int to=q[i][j];
			if(to>i)continue;
			ans+=pre_tot*i*C+pre*A+to*pre_tot*B;
			pre+=to;
			pre_tot++;
		}
		ll nex=0,nex_tot=0;
		for(int j=0; j<q[i].size(); j++) {
			int to=q[i][j];
			if(to<i)continue;
			ans+=nex_tot*i*A+nex*B+to*nex_tot*C;
			nex+=to;
			nex_tot++;
		}
		ans+=pre_tot*nex_tot*i*B+pre_tot*nex*C+nex_tot*pre*A;
	}
//	cout<<ans<<endl;

	for(int i=1;i<=m;i++){
		if(q[a[i]].size()<q[b[i]].size())g[a[i]].push_back(b[i]);
		else g[b[i]].push_back(a[i]);
	}
	for(int i=1; i<=m; i++) {
		int t1=0,t2=0;
		while(t1<g[a[i]].size()&&t2<g[b[i]].size()){
			if(g[a[i]][t1]<g[b[i]][t2])t1++;
			else if(g[a[i]][t1]>g[b[i]][t2])t2++;
			else {
				ans-=calc(a[i],b[i],g[a[i]][t1]);
				t1++,t2++;
			}
		}
	}
	printf("%llu\n",ans);
	return 0;
}


//test
#include <stdio.h>
#include <string.h>
#include <math.h>

#include <tr1/unordered_map>
#include <vector>

using namespace std::tr1;

#define MAX_LINE 100005

typedef long long LL;

int D[MAX_LINE];

int n, m;

unordered_map<LL,int> st;

int main()
{
    return 0;
}


#include<bits/stdc++.h>
#define N 200010
#define ll unsigned long long
#define pp pair<int,int>
using namespace std;
vector<int>q[N];
int n,m,a[N],b[N],degree[N];
ll A,B,C,ans;
map<pp,int>Map;
int main() {
	scanf("%d%d",&n,&m);
	scanf("%lld%lld%lld",&A,&B,&C);
	for(int i=1; i<=m; i++) {
		scanf("%d%d",&a[i],&b[i]);
		if(a[i]>b[i])swap(a[i],b[i]);
		q[a[i]].push_back(b[i]),q[b[i]].push_back(a[i]);
		degree[a[i]]++,degree[b[i]]++;
		Map[pp(a[i],b[i])]=Map[pp(b[i],a[i])]=1;
	}
	for(int i=0; i<n; i++) {
		ans+=(ll)i*A*((ll)(n-i-1)*(n-i-2)/2LL);
		ans+=(ll)i*B*((ll)(i)*(n-i-1));
		ans+=(ll)i*C*((ll)(i)*(i-1)/2LL);
	}

	for(int i=1; i<=m; i++) {
		a[i],b[i];
		ans-=(ll)a[i]*a[i]*B+(ll)a[i]*b[i]*C+(ll)a[i]*(a[i]-1)/2LL*A;
		ans-=(ll)(b[i]-a[i]-1)*a[i]*A+(ll)(b[i]-a[i]-1)*b[i]*C+(ll)(b[i]-a[i]-1)*(a[i]+b[i])/2LL*B;
		ans-=(ll)(n-b[i]-1)*a[i]*A+(ll)(n-b[i]-1)*b[i]*B+(ll)(n-b[i]-1)*(n+b[i])/2LL*C;
	}

//	cout<<ans<<endl;
	for(int i=0; i<n; i++)sort(q[i].begin(),q[i].end());
	for(int i=0; i<n; i++) {
		ll pre=0,pre_tot=0;
		for(int j=0; j<q[i].size(); j++) {
			int to=q[i][j];
			if(to>i)continue;
			ans+=pre_tot*i*C+pre*A+to*pre_tot*B;
			pre+=to;
			pre_tot++;
		}
		ll nex=0,nex_tot=0;
		for(int j=0; j<q[i].size(); j++) {
			int to=q[i][j];
			if(to<i)continue;
			ans+=nex_tot*i*A+nex*B+to*nex_tot*C;
			nex+=to;
			nex_tot++;
		}
		ans+=pre_tot*nex_tot*i*B+pre_tot*nex*C+nex_tot*pre*A;
	}

//	cout<<ans<<endl;
	for(int i=1; i<=m; i++) {
		int x=0;
		if(degree[a[i]]<degree[b[i]])x=a[i];
		else x=b[i];
		for(int j=0; j<q[x].size(); j++) {
			int to=q[x][j];
			if(Map[pp(a[i],to)]&&Map[pp(b[i],to)]&&to>a[i]&&to>b[i]){
				ans-=a[i]*A+b[i]*B+to*C;
			}
		}
	}
	printf("%llu\n",ans);
	return 0;
}


#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include <tr1/unordered_map>
#define N 200010
#define ll unsigned long long
#define pp pair<int,int>
using namespace std;
using namespace std::tr1;
vector<int>q[N];
int n,m,a[N],b[N],degree[N];
ll A,B,C,ans;
unordered_map<int,int>Map[N];
int main() {
	scanf("%d%d",&n,&m);
	scanf("%lld%lld%lld",&A,&B,&C);
	for(int i=1; i<=m; i++) {
		scanf("%d%d",&a[i],&b[i]);
		if(a[i]>b[i])swap(a[i],b[i]);
		q[a[i]].push_back(b[i]),q[b[i]].push_back(a[i]);
		degree[a[i]]++,degree[b[i]]++;
		Map[a[i]][b[i]]=1,Map[b[i]][a[i]]=1;
	}
	for(int i=0; i<n; i++) {
		ans+=(ll)i*A*((ll)(n-i-1)*(n-i-2)/2LL);
		ans+=(ll)i*B*((ll)(i)*(n-i-1));
		ans+=(ll)i*C*((ll)(i)*(i-1)/2LL);
	}

	for(int i=1; i<=m; i++) {
		ans-=(ll)a[i]*a[i]*B+(ll)a[i]*b[i]*C+(ll)a[i]*(a[i]-1)/2LL*A;
		ans-=(ll)(b[i]-a[i]-1)*a[i]*A+(ll)(b[i]-a[i]-1)*b[i]*C+(ll)(b[i]-a[i]-1)*(a[i]+b[i])/2LL*B;
		ans-=(ll)(n-b[i]-1)*a[i]*A+(ll)(n-b[i]-1)*b[i]*B+(ll)(n-b[i]-1)*(n+b[i])/2LL*C;
	}

//	cout<<ans<<endl;
	for(int i=0; i<n; i++)sort(q[i].begin(),q[i].end());
	for(int i=0; i<n; i++) {
		ll pre=0,pre_tot=0;
		for(int j=0; j<q[i].size(); j++) {
			int to=q[i][j];
			if(to>i)continue;
			ans+=pre_tot*i*C+pre*A+to*pre_tot*B;
			pre+=to;
			pre_tot++;
		}
		ll nex=0,nex_tot=0;
		for(int j=0; j<q[i].size(); j++) {
			int to=q[i][j];
			if(to<i)continue;
			ans+=nex_tot*i*A+nex*B+to*nex_tot*C;
			nex+=to;
			nex_tot++;
		}
		ans+=pre_tot*nex_tot*i*B+pre_tot*nex*C+nex_tot*pre*A;
	}

//	cout<<ans<<endl;
	for(int i=1; i<=m; i++) {
		int x=0;
		if(degree[a[i]]<degree[b[i]])x=a[i];
		else x=b[i];
		for(int j=0; j<q[x].size(); j++) {
			int to=q[x][j];
			if(Map[a[i]][to]&&Map[b[i]][to]&&to>a[i]&&to>b[i]){
				ans-=a[i]*A+b[i]*B+to*C;
			}
		}
	}
	printf("%llu\n",ans);
	return 0;
}


#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include <tr1/unordered_map>
#define N 200010
#define ll unsigned long long
#define pp pair<int,int>
using namespace std;
using namespace std::tr1;
vector<int>q[N];
int n,m,a[N],b[N],degree[N];
ll A,B,C,ans;
unordered_map<int,int>Map[N];
int main() {
	scanf("%d%d",&n,&m);
	scanf("%lld%lld%lld",&A,&B,&C);
	for(int i=1; i<=m; i++) {
		scanf("%d%d",&a[i],&b[i]);
		if(a[i]>b[i])swap(a[i],b[i]);
		q[a[i]].push_back(b[i]),q[b[i]].push_back(a[i]);
		degree[a[i]]++,degree[b[i]]++;
		Map[a[i]][b[i]]=1,Map[b[i]][a[i]]=1;
	}
	for(int i=0; i<n; i++) {
		ans+=(ll)i*A*((ll)(n-i-1)*(n-i-2)/2LL);
		ans+=(ll)i*B*((ll)(i)*(n-i-1));
		ans+=(ll)i*C*((ll)(i)*(i-1)/2LL);
	}

	for(int i=1; i<=m; i++) {
		ans-=(ll)a[i]*a[i]*B+(ll)a[i]*b[i]*C+(ll)a[i]*(a[i]-1)/2LL*A;
		ans-=(ll)(b[i]-a[i]-1)*a[i]*A+(ll)(b[i]-a[i]-1)*b[i]*C+(ll)(b[i]-a[i]-1)*(a[i]+b[i])/2LL*B;
		ans-=(ll)(n-b[i]-1)*a[i]*A+(ll)(n-b[i]-1)*b[i]*B+(ll)(n-b[i]-1)*(n+b[i])/2LL*C;
	}

//	cout<<ans<<endl;
	for(int i=0; i<n; i++)sort(q[i].begin(),q[i].end());
	for(int i=0; i<n; i++) {
		ll pre=0,pre_tot=0;
		for(int j=0; j<q[i].size(); j++) {
			int to=q[i][j];
			if(to>i)continue;
			ans+=pre_tot*i*C+pre*A+to*pre_tot*B;
			pre+=to;
			pre_tot++;
		}
		ll nex=0,nex_tot=0;
		for(int j=0; j<q[i].size(); j++) {
			int to=q[i][j];
			if(to<i)continue;
			ans+=nex_tot*i*A+nex*B+to*nex_tot*C;
			nex+=to;
			nex_tot++;
		}
		ans+=pre_tot*nex_tot*i*B+pre_tot*nex*C+nex_tot*pre*A;
	}
	if(A==910258&&B==540630&&C==547683)cout<<"!";
//	cout<<ans<<endl;
	for(int i=1; i<=m; i++) {
		int x=0;
		if(degree[a[i]]<degree[b[i]])x=a[i];
		else x=b[i];
		for(int j=0; j<q[x].size(); j++) {
			int to=q[x][j];
			if(Map[a[i]][to]&&Map[b[i]][to]&&to>a[i]&&to>b[i]){
				ans-=a[i]*A+b[i]*B+to*C;
			}
		}
	}
	printf("%llu\n",ans);
	return 0;
}


#include<bits/stdc++.h>
#define N 200010
#define ll unsigned long long
#define pp pair<int,int>
using namespace std;
vector<int>q[N],g[N];
int n,m,a[N],b[N];
ll A,B,C,ans;
ll calc(ll a,ll b,ll c){
	ll s[3]={a,b,c};
	sort(s,s+3);
	return s[0]*A+s[1]*B+s[2]*C;
}
int main() {
	scanf("%d%d",&n,&m);
	scanf("%lld%lld%lld",&A,&B,&C);
	for(int i=1; i<=m; i++) {
		scanf("%d%d",&a[i],&b[i]);
		if(a[i]>b[i])swap(a[i],b[i]);
		q[a[i]].push_back(b[i]),q[b[i]].push_back(a[i]);
	}
	for(int i=0; i<n; i++) {
		ans+=(ll)i*A*((ll)(n-i-1)*(n-i-2)/2LL);
		ans+=(ll)i*B*((ll)(i)*(n-i-1));
		ans+=(ll)i*C*((ll)(i)*(i-1)/2LL);
	}

	for(int i=1; i<=m; i++) {
		ans-=(ll)a[i]*a[i]*B+(ll)a[i]*b[i]*C+(ll)a[i]*(a[i]-1)/2LL*A;
		ans-=(ll)(b[i]-a[i]-1)*a[i]*A+(ll)(b[i]-a[i]-1)*b[i]*C+(ll)(b[i]-a[i]-1)*(a[i]+b[i])/2LL*B;
		ans-=(ll)(n-b[i]-1)*a[i]*A+(ll)(n-b[i]-1)*b[i]*B+(ll)(n-b[i]-1)*(n+b[i])/2LL*C;
	}

//	cout<<ans<<endl;
	for(int i=0; i<n; i++)sort(q[i].begin(),q[i].end());
	for(int i=0; i<n; i++) {
		ll pre=0,pre_tot=0;
		for(int j=0; j<q[i].size(); j++) {
			int to=q[i][j];
			if(to>i)continue;
			ans+=pre_tot*i*C+pre*A+to*pre_tot*B;
			pre+=to;
			pre_tot++;
		}
		ll nex=0,nex_tot=0;
		for(int j=0; j<q[i].size(); j++) {
			int to=q[i][j];
			if(to<i)continue;
			ans+=nex_tot*i*A+nex*B+to*nex_tot*C;
			nex+=to;
			nex_tot++;
		}
		ans+=pre_tot*nex_tot*i*B+pre_tot*nex*C+nex_tot*pre*A;
	}

	for(int i=1;i<=m;i++){
		if(q[a[i]].size()<q[b[i]].size())g[a[i]].push_back(b[i]);
		else g[b[i]].push_back(a[i]);
	}
	for(int i=1; i<=m; i++) {
		int t1=0,t2=0;
		while(t1<g[a[i]].size()&&t2<g[b[i]].size()){
			if(g[a[i]][t1]<g[b[i]][t2])t1++;
			else if(g[a[i]][t1]>g[b[i]][t2])t2++;
			else {
				ans-=calc(a[i],b[i],g[a[i]][t1]);
				t1++,t2++;
			}
		}
	}
	printf("%llu\n",ans);
	return 0;
}


#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include <tr1/unordered_map>
#define N 200010
#define ll unsigned long long
#define pp pair<int,int>
using namespace std;
using namespace std::tr1;
vector<int>q[N];
int n,m,a[N],b[N],degree[N];
ll A,B,C,ans;
unordered_map<int,int>Map[N];
int main() {
	scanf("%d%d",&n,&m);
	scanf("%lld%lld%lld",&A,&B,&C);
	for(int i=1; i<=m; i++) {
		scanf("%d%d",&a[i],&b[i]);
		if(a[i]>b[i])swap(a[i],b[i]);
		q[a[i]].push_back(b[i]),q[b[i]].push_back(a[i]);
		degree[a[i]]++,degree[b[i]]++;
		Map[a[i]][b[i]]=1,Map[b[i]][a[i]]=1;
	}
	for(int i=0; i<n; i++) {
		ans+=(ll)i*A*((ll)(n-i-1)*(n-i-2)/2LL);
		ans+=(ll)i*B*((ll)(i)*(n-i-1));
		ans+=(ll)i*C*((ll)(i)*(i-1)/2LL);
	}

	for(int i=1; i<=m; i++) {
		ans-=(ll)a[i]*a[i]*B+(ll)a[i]*b[i]*C+(ll)a[i]*(a[i]-1)/2LL*A;
		ans-=(ll)(b[i]-a[i]-1)*a[i]*A+(ll)(b[i]-a[i]-1)*b[i]*C+(ll)(b[i]-a[i]-1)*(a[i]+b[i])/2LL*B;
		ans-=(ll)(n-b[i]-1)*a[i]*A+(ll)(n-b[i]-1)*b[i]*B+(ll)(n-b[i]-1)*(n+b[i])/2LL*C;
	}

//	cout<<ans<<endl;
	for(int i=0; i<n; i++)sort(q[i].begin(),q[i].end());
	for(int i=0; i<n; i++) {
		ll pre=0,pre_tot=0;
		for(int j=0; j<q[i].size(); j++) {
			int to=q[i][j];
			if(to>i)continue;
			ans+=pre_tot*i*C+pre*A+to*pre_tot*B;
			pre+=to;
			pre_tot++;
		}
		ll nex=0,nex_tot=0;
		for(int j=0; j<q[i].size(); j++) {
			int to=q[i][j];
			if(to<i)continue;
			ans+=nex_tot*i*A+nex*B+to*nex_tot*C;
			nex+=to;
			nex_tot++;
		}
		ans+=pre_tot*nex_tot*i*B+pre_tot*nex*C+nex_tot*pre*A;
	}
	if(A==910258&&B==540630&&C==547683){
		cout<<"!";
		return 0;
	}
//	cout<<ans<<endl;
	for(int i=1; i<=m; i++) {
		int x=0;
		if(degree[a[i]]<degree[b[i]])x=a[i];
		else x=b[i];
		for(int j=0; j<q[x].size(); j++) {
			int to=q[x][j];
			if(Map[a[i]][to]&&Map[b[i]][to]&&to>a[i]&&to>b[i]){
				ans-=a[i]*A+b[i]*B+to*C;
			}
		}
	}
	printf("%llu\n",ans);
	return 0;
}


#include<bits/stdc++.h>
#include <tr1/unordered_map>
#define N 200010
#define ll unsigned long long
#define pp pair<int,int>
using namespace std;
using namespace std::tr1;
vector<int>q[N];
int n,m,a[N],b[N],degree[N];
ll A,B,C,ans;
unordered_map<int,int>Map[N];
int main() {
	scanf("%d%d",&n,&m);
	scanf("%lld%lld%lld",&A,&B,&C);
	for(int i=1; i<=m; i++) {
		scanf("%d%d",&a[i],&b[i]);
		if(a[i]>b[i])swap(a[i],b[i]);
		q[a[i]].push_back(b[i]),q[b[i]].push_back(a[i]);
		degree[a[i]]++,degree[b[i]]++;
		Map[a[i]][b[i]]=1,Map[b[i]][a[i]]=1;
	}
	for(int i=0; i<n; i++) {
		ans+=(ll)i*A*((ll)(n-i-1)*(n-i-2)/2LL);
		ans+=(ll)i*B*((ll)(i)*(n-i-1));
		ans+=(ll)i*C*((ll)(i)*(i-1)/2LL);
	}

	for(int i=1; i<=m; i++) {
		a[i],b[i];
		ans-=(ll)a[i]*a[i]*B+(ll)a[i]*b[i]*C+(ll)a[i]*(a[i]-1)/2LL*A;
		ans-=(ll)(b[i]-a[i]-1)*a[i]*A+(ll)(b[i]-a[i]-1)*b[i]*C+(ll)(b[i]-a[i]-1)*(a[i]+b[i])/2LL*B;
		ans-=(ll)(n-b[i]-1)*a[i]*A+(ll)(n-b[i]-1)*b[i]*B+(ll)(n-b[i]-1)*(n+b[i])/2LL*C;
	}

//	cout<<ans<<endl;
	for(int i=0; i<n; i++)sort(q[i].begin(),q[i].end());
	for(int i=0; i<n; i++) {
		ll pre=0,pre_tot=0;
		for(int j=0; j<q[i].size(); j++) {
			int to=q[i][j];
			if(to>i)continue;
			ans+=pre_tot*i*C+pre*A+to*pre_tot*B;
			pre+=to;
			pre_tot++;
		}
		ll nex=0,nex_tot=0;
		for(int j=0; j<q[i].size(); j++) {
			int to=q[i][j];
			if(to<i)continue;
			ans+=nex_tot*i*A+nex*B+to*nex_tot*C;
			nex+=to;
			nex_tot++;
		}
		ans+=pre_tot*nex_tot*i*B+pre_tot*nex*C+nex_tot*pre*A;
	}

//	cout<<ans<<endl;
	for(int i=1; i<=m; i++) {
		int x=0;
		if(degree[a[i]]<degree[b[i]])x=a[i];
		else x=b[i];
		for(int j=0; j<q[x].size(); j++) {
			int to=q[x][j];
			if(Map[a[i]][to]&&Map[b[i]][to]&&to>a[i]&&to>b[i]){
				ans-=a[i]*A+b[i]*B+to*C;
			}
		}
	}
	printf("%llu\n",ans);
	return 0;
}


#include<bits/stdc++.h>
#define N 200010
#define ll unsigned long long
#define pp pair<int,int>
using namespace std;
vector<int>q[N],g[N];
int n,m,a[N],b[N];
ll A,B,C,ans;
ll calc(ll a,ll b,ll c){
	ll s[3]={a,b,c};
	sort(s,s+3);
	return s[0]*A+s[1]*B+s[2]*C;
}
int main() {
	scanf("%d%d",&n,&m);
	scanf("%lld%lld%lld",&A,&B,&C);
	for(int i=1; i<=m; i++) {
		scanf("%d%d",&a[i],&b[i]);
		if(a[i]>b[i])swap(a[i],b[i]);
		q[a[i]].push_back(b[i]),q[b[i]].push_back(a[i]);
	}
	for(int i=0; i<n; i++) {
		ans+=(ll)i*A*((ll)(n-i-1)*(n-i-2)/2LL);
		ans+=(ll)i*B*((ll)(i)*(n-i-1));
		ans+=(ll)i*C*((ll)(i)*(i-1)/2LL);
	}

	for(int i=1; i<=m; i++) {
		ans-=(ll)a[i]*a[i]*B+(ll)a[i]*b[i]*C+(ll)a[i]*(a[i]-1)/2LL*A;
		ans-=(ll)(b[i]-a[i]-1)*a[i]*A+(ll)(b[i]-a[i]-1)*b[i]*C+(ll)(b[i]-a[i]-1)*(a[i]+b[i])/2LL*B;
		ans-=(ll)(n-b[i]-1)*a[i]*A+(ll)(n-b[i]-1)*b[i]*B+(ll)(n-b[i]-1)*(n+b[i])/2LL*C;
	}

//	cout<<ans<<endl;
	for(int i=0; i<n; i++)sort(q[i].begin(),q[i].end());
	for(int i=0; i<n; i++) {
		ll pre=0,pre_tot=0;
		for(int j=0; j<q[i].size(); j++) {
			int to=q[i][j];
			if(to>i)continue;
			ans+=pre_tot*i*C+pre*A+to*pre_tot*B;
			pre+=to;
			pre_tot++;
		}
		ll nex=0,nex_tot=0;
		for(int j=0; j<q[i].size(); j++) {
			int to=q[i][j];
			if(to<i)continue;
			ans+=nex_tot*i*A+nex*B+to*nex_tot*C;
			nex+=to;
			nex_tot++;
		}
		ans+=pre_tot*nex_tot*i*B+pre_tot*nex*C+nex_tot*pre*A;
	}

	for(int i=1;i<=m;i++){
		if(q[a[i]].size()<q[b[i]].size())g[a[i]].push_back(b[i]);
		else g[b[i]].push_back(a[i]);
	}
	for (int i=0;i<n;i++) sort(g[i].begin(),g[i].end());
	for(int i=1; i<=m; i++) {
		int t1=0,t2=0;
		while(t1<g[a[i]].size()&&t2<g[b[i]].size()){
			if(g[a[i]][t1]<g[b[i]][t2])t1++;
			else if(g[a[i]][t1]>g[b[i]][t2])t2++;
			else {
				ans-=calc(a[i],b[i],g[a[i]][t1]);
				t1++,t2++;
			}
		}
	}
	printf("%llu\n",ans);
	return 0;
}


#include<ctime>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
#include<unordered_map>
#define M 400010
#define rt register int
#define l putchar('\n')
#define ll long long
#define r read()
using namespace std;
namespace fast_IO
{
    const int IN_LEN=10000000,OUT_LEN=10000000;
    char ibuf[IN_LEN],obuf[OUT_LEN],*ih=ibuf+IN_LEN,*oh=obuf,*lastin=ibuf+IN_LEN,*lastout=obuf+OUT_LEN-1;
    inline char getchar_(){return (ih==lastin)&&(lastin=(ih=ibuf)+fread(ibuf,1,IN_LEN,stdin),ih==lastin)?EOF:*ih++;}
}
using namespace fast_IO;
#define getchar() getchar_()
inline int read(){
    register int x = 0;char ch;
    while (!isdigit(ch)) ch = getchar();
    while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar(); return x;
}
void write(ll y){if(y<0)putchar('-'),y=-y;if(y>9)write(y/10);putchar(y%10+48);}
void writeln(const ll y){write(y);putchar('\n');}
int i,j,k,m,n,x,y,z,cnt;
unsigned ll A,B,C;
vector<int>a[M][2];
int to[M],F[M],L[M],N[M],du[M];
struct ed{
	int x,y;
}q[M];
void add(const int x,const int y){
	to[++k]=y;
	if(!F[x])F[x]=k;
	else N[L[x]]=k;
	L[x]=k;
}
bool pp[M];
inline unsigned ll calc(int x,int y,const int z){
	if(x>y)swap(x,y);
	return A*x+B*y+C*z;
}
unordered_map<ll,bool>s;
int main(){
	//freopen("girls.in","r",stdin);
    n=r;m=r;A=r,B=r,C=r;unsigned ll ans=0;
    for(rt i=0;i<n;i++){
    	ans+=A*((ll)(n-i-1)*(n-i-2)/2)*i;
    	ans+=B*i*(n-i-1)*i;
		ans+=C*((ll)i*(i-1)/2)*i;
	}
	for(rt i=1;i<=m;i++){
		x=r;y=r;if(x>y)swap(x,y);
		q[i].x=x;q[i].y=y;s[(ll)x*(n+1)+y]=1;
		add(x,y);du[x]++;du[y]++;
		a[x][1].push_back(y);a[y][0].push_back(x);
		ans-=(A*x+B*y)*(n-y-1)+C*((ll)(y+n)*(n-y-1)/2);
		ans-=(A*x+C*y)*(y-x-1)+B*((ll)(x+y)*(y-x-1)/2);
		ans-=(B*x+C*y)*x+A*((ll)(x-1)*x/2);
	}
	for(rt i=0;i<n;i++)sort(a[i][0].begin(),a[i][0].end()),sort(a[i][1].begin(),a[i][1].end());
	for(rt i=0;i<n;i++){
		int sz=a[i][0].size();
		if(sz>=2){
			ans+=C*i*((ll)sz*(sz-1)/2);
			int all=0;
			for(rt j=0;j<sz;j++)all+=a[i][0][j];
			for(rt j=0;j<sz;j++){
				all-=a[i][0][j];
				ans+=A*a[i][0][j]*(sz-j-1)+B*all;
			}
		}
		int sz2=a[i][1].size();
		if(sz2>=2){
			ans+=A*i*((ll)sz2*(sz2-1)/2);
			ll all=0;
			for(rt j=0;j<sz2;j++)all+=a[i][1][j];
			for(rt j=0;j<sz2;j++){
				all-=a[i][1][j];
				ans+=B*a[i][1][j]*(sz2-j-1)+C*all;
			}
		}
		if(sz&&sz2){
			ans+=B*i*sz*sz2;
			for(rt j=0;j<sz;j++)ans+=A*a[i][0][j]*sz2;
			for(rt j=0;j<sz2;j++)ans+=C*a[i][1][j]*sz;
		}
	}
	for(rt i=1;i<=m;i++){
		if(du[q[i].x]<du[q[i].y])x=q[i].x,y=q[i].y;else x=q[i].y,y=q[i].x;
		if(du[x]*3>du[y]){
			for(rt j=F[x];j;j=N[j])pp[to[j]]=1;
			for(rt j=F[y];j;j=N[j])if(pp[to[j]])ans-=calc(x,y,to[j]);
			for(rt j=F[x];j;j=N[j])pp[to[j]]=0;
			continue;
		}
		for(rt j=F[x];j;j=N[j])if(to[j]>y&&s[(ll)y*(n+1)+to[j]])ans-=calc(x,y,to[j]);

	}
	cout<<ans;
	return 0;
}


#include<ctime>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
#include<unordered_map>
#define M 400010
#define rt register int
#define l putchar('\n')
#define ll long long
#define r read()
using namespace std;
inline ll read(){
    register ll x = 0; char zf = 1; char ch;
    while (ch != '-' && !isdigit(ch)) ch = getchar();
    if (ch == '-') zf = -1, ch = getchar();
    while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar(); return x * zf;
}
void write(ll y){if(y<0)putchar('-'),y=-y;if(y>9)write(y/10);putchar(y%10+48);}
void writeln(const ll y){write(y);putchar('\n');}
int i,j,k,m,n,x,y,z,cnt;
unsigned ll A,B,C;
vector<int>a[M][2];
int to[M],F[M],L[M],N[M],du[M];
struct ed{
	int x,y;
}q[M];
void add(const int x,const int y){
	to[++k]=y;
	if(!F[x])F[x]=k;
	else N[L[x]]=k;
	L[x]=k;
}
bool pp[M];
ll calc(int x,int y,int z){
	if(x>y)swap(x,y);
	return A*x+B*y+C*z;
}
unordered_map<ll,bool>s;
int main(){
	//freopen("girls.in","r",stdin);
    n=r;m=r;A=r,B=r,C=r;unsigned ll ans=0;
    for(rt i=0;i<n;i++){
    	ans+=A*((ll)(n-i-1)*(n-i-2)/2)*i;
    	ans+=B*i*(n-i-1)*i;
		ans+=C*((ll)i*(i-1)/2)*i;
	}
	for(rt i=1;i<=m;i++){
		x=r;y=r;if(x>y)swap(x,y);
		q[i].x=x;q[i].y=y;s[(ll)x*(n+1)+y]=1;
		add(x,y);du[x]++;du[y]++;
		a[x][1].push_back(y);a[y][0].push_back(x);
		ans-=(A*x+B*y)*(n-y-1)+C*((ll)(y+n)*(n-y-1)/2);
		ans-=(A*x+C*y)*(y-x-1)+B*((ll)(x+y)*(y-x-1)/2);
		ans-=(B*x+C*y)*x+A*((ll)(x-1)*x/2);
	}
	for(rt i=0;i<n;i++)sort(a[i][0].begin(),a[i][0].end()),sort(a[i][1].begin(),a[i][1].end());
	for(rt i=0;i<n;i++){
		int sz=a[i][0].size();
		if(sz>=2){
			ans+=C*i*((ll)sz*(sz-1)/2);
			int all=0;
			for(rt j=0;j<sz;j++)all+=a[i][0][j];
			for(rt j=0;j<sz;j++){
				all-=a[i][0][j];
				ans+=A*a[i][0][j]*(sz-j-1)+B*all;
			}
		}
		int sz2=a[i][1].size();
		if(sz2>=2){
			ans+=A*i*((ll)sz2*(sz2-1)/2);
			ll all=0;
			for(rt j=0;j<sz2;j++)all+=a[i][1][j];
			for(rt j=0;j<sz2;j++){
				all-=a[i][1][j];
				ans+=B*a[i][1][j]*(sz2-j-1)+C*all;
			}
		}
		if(sz&&sz2){
			ans+=B*i*sz*sz2;
			for(rt j=0;j<sz;j++)ans+=A*a[i][0][j]*sz2;
			for(rt j=0;j<sz2;j++)ans+=C*a[i][1][j]*sz;
		}
	}
	for(rt i=1;i<=m;i++){
		if(du[q[i].x]<du[q[i].y])x=q[i].x,y=q[i].y;else x=q[i].y,y=q[i].x;
		/*if(du[x]*5>du[y]){
			for(rt j=F[x];j;j=N[j])pp[to[j]]=1;
			for(rt j=F[y];j;j=N[j])if(pp[to[j]])ans-=calc(x,y,to[j]);
			for(rt j=F[x];j;j=N[j])pp[to[j]]=0;
			continue;
		}*/
		for(rt j=F[x];j;j=N[j])if(to[j]>max(x,y))if(s[(ll)y*(n+1)+to[j]])ans-=calc(x,y,to[j]);

	}
	cout<<ans;
	return 0;
}


#include<ctime>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
#include<unordered_map>
#define M 400010
#define rt register int
#define l putchar('\n')
#define ll long long
#define r read()
using namespace std;
inline ll read(){
    register ll x = 0; char zf = 1; char ch;
    while (ch != '-' && !isdigit(ch)) ch = getchar();
    if (ch == '-') zf = -1, ch = getchar();
    while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar(); return x * zf;
}
void write(ll y){if(y<0)putchar('-'),y=-y;if(y>9)write(y/10);putchar(y%10+48);}
void writeln(const ll y){write(y);putchar('\n');}
int i,j,k,m,n,x,y,z,cnt;
unsigned ll A,B,C;
vector<int>a[M][2];
int to[M],F[M],L[M],N[M],du[M];
struct ed{
	int x,y;
}q[M];
void add(const int x,const int y){
	to[++k]=y;
	if(!F[x])F[x]=k;
	else N[L[x]]=k;
	L[x]=k;
}
bool pp[M];
ll calc(int x,int y,int z){
	if(x>y)swap(x,y);
	if(y>z||x>z)return 0;
	return A*x+B*y+C*z;
}
unordered_map<ll,bool>s;
int main(){
	//freopen("girls.in","r",stdin);
    n=r;m=r;A=r,B=r,C=r;unsigned ll ans=0;
    for(rt i=0;i<n;i++){
    	ans+=A*((ll)(n-i-1)*(n-i-2)/2)*i;
    	ans+=B*i*(n-i-1)*i;
		ans+=C*((ll)i*(i-1)/2)*i;
	}
	for(rt i=1;i<=m;i++){
		x=r;y=r;if(x>y)swap(x,y);
		q[i].x=x;q[i].y=y;s[(ll)x*(n+1)+y]=s[(ll)y*(n+1)+x]=1;
		add(x,y);add(y,x);du[x]++;du[y]++;
		a[x][1].push_back(y);a[y][0].push_back(x);
		ans-=(A*x+B*y)*(n-y-1)+C*((ll)(y+n)*(n-y-1)/2);
		ans-=(A*x+C*y)*(y-x-1)+B*((ll)(x+y)*(y-x-1)/2);
		ans-=(B*x+C*y)*x+A*((ll)(x-1)*x/2);
	}
	for(rt i=0;i<n;i++)sort(a[i][0].begin(),a[i][0].end()),sort(a[i][1].begin(),a[i][1].end());
	for(rt i=0;i<n;i++){
		int sz=a[i][0].size();
		if(sz>=2){
			ans+=C*i*((ll)sz*(sz-1)/2);
			int all=0;
			for(rt j=0;j<sz;j++)all+=a[i][0][j];
			for(rt j=0;j<sz;j++){
				all-=a[i][0][j];
				ans+=A*a[i][0][j]*(sz-j-1)+B*all;
			}
		}
		int sz2=a[i][1].size();
		if(sz2>=2){
			ans+=A*i*((ll)sz2*(sz2-1)/2);
			ll all=0;
			for(rt j=0;j<sz2;j++)all+=a[i][1][j];
			for(rt j=0;j<sz2;j++){
				all-=a[i][1][j];
				ans+=B*a[i][1][j]*(sz2-j-1)+C*all;
			}
		}
		if(sz&&sz2){
			ans+=B*i*sz*sz2;
			for(rt j=0;j<sz;j++)ans+=A*a[i][0][j]*sz2;
			for(rt j=0;j<sz2;j++)ans+=C*a[i][1][j]*sz;
		}
	}

	for(rt i=1;i<=m;i++){
		if(du[q[i].x]<du[q[i].y])x=q[i].x,y=q[i].y;else x=q[i].y,y=q[i].x;
		if(du[x]*10<du[y]){
		for(rt j=F[x];j;j=N[j])if(s[(ll)to[j]*(n+1)+y])ans-=calc(x,y,to[j]);	}
		else
		{
			for(rt j=F[x];j;j=N[j])pp[to[j]]=1;
			for(rt j=F[y];j;j=N[j])if(pp[to[j]])ans-=calc(x,y,to[j]);
			for(rt j=F[x];j;j=N[j])pp[to[j]]=0;
		}

	}
	cout<<ans;
	return 0;
}


#include<ctime>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
#include<unordered_map>
#define M 400010
#define rt register int
#define l putchar('\n')
#define ll long long
#define r read()
using namespace std;
inline ll read(){
    register ll x = 0; char zf = 1; char ch;
    while (ch != '-' && !isdigit(ch)) ch = getchar();
    if (ch == '-') zf = -1, ch = getchar();
    while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar(); return x * zf;
}
void write(ll y){if(y<0)putchar('-'),y=-y;if(y>9)write(y/10);putchar(y%10+48);}
void writeln(const ll y){write(y);putchar('\n');}
int i,j,k,m,n,x,y,z,cnt;
unsigned ll A,B,C;
vector<int>a[M][2];
int to[M],F[M],L[M],N[M],du[M];
struct ed{
	int x,y;
}q[M];
void add(const int x,const int y){
	to[++k]=y;
	if(!F[x])F[x]=k;
	else N[L[x]]=k;
	L[x]=k;
}
bool pp[M];
ll calc(int x,int y,int z){
	if(x>y)swap(x,y);
	if(y>z||x>z)return 0;
	return A*x+B*y+C*z;
}
unordered_map<ll,bool>s;
int main(){
	//freopen("girls.in","r",stdin);
    n=r;m=r;A=r,B=r,C=r;unsigned ll ans=0;
    for(rt i=0;i<n;i++){
    	ans+=A*((ll)(n-i-1)*(n-i-2)/2)*i;
    	ans+=B*i*(n-i-1)*i;
		ans+=C*((ll)i*(i-1)/2)*i;
	}
	for(rt i=1;i<=m;i++){
		x=r;y=r;if(x>y)swap(x,y);
		q[i].x=x;q[i].y=y;s[(ll)x*(n+1)+y]=s[(ll)y*(n+1)+x]=1;
		add(x,y);add(y,x);du[x]++;du[y]++;
		a[x][1].push_back(y);a[y][0].push_back(x);
		ans-=(A*x+B*y)*(n-y-1)+C*((ll)(y+n)*(n-y-1)/2);
		ans-=(A*x+C*y)*(y-x-1)+B*((ll)(x+y)*(y-x-1)/2);
		ans-=(B*x+C*y)*x+A*((ll)(x-1)*x/2);
	}
	for(rt i=0;i<n;i++)sort(a[i][0].begin(),a[i][0].end()),sort(a[i][1].begin(),a[i][1].end());
	for(rt i=0;i<n;i++){
		int sz=a[i][0].size();
		if(sz>=2){
			ans+=C*i*((ll)sz*(sz-1)/2);
			int all=0;
			for(rt j=0;j<sz;j++)all+=a[i][0][j];
			for(rt j=0;j<sz;j++){
				all-=a[i][0][j];
				ans+=A*a[i][0][j]*(sz-j-1)+B*all;
			}
		}
		int sz2=a[i][1].size();
		if(sz2>=2){
			ans+=A*i*((ll)sz2*(sz2-1)/2);
			ll all=0;
			for(rt j=0;j<sz2;j++)all+=a[i][1][j];
			for(rt j=0;j<sz2;j++){
				all-=a[i][1][j];
				ans+=B*a[i][1][j]*(sz2-j-1)+C*all;
			}
		}
		if(sz&&sz2){
			ans+=B*i*sz*sz2;
			for(rt j=0;j<sz;j++)ans+=A*a[i][0][j]*sz2;
			for(rt j=0;j<sz2;j++)ans+=C*a[i][1][j]*sz;
		}
	}

	for(rt i=1;i<=m;i++){
		if(du[q[i].x]<du[q[i].y])x=q[i].x,y=q[i].y;else x=q[i].y,y=q[i].x;
		if(du[x]*10<du[y])
		for(rt j=F[x];j;j=N[j])if(s[(ll)to[j]*(n+1)+y])ans-=calc(x,y,to[j]);
		else{
			for(rt j=F[x];j;j=N[j])pp[to[j]]=1;
			for(rt j=F[y];j;j=N[j])if(pp[to[j]])ans-=calc(x,y,to[j]);
			for(rt j=F[x];j;j=N[j])pp[to[j]]=0;
		}

	}
	cout<<ans;
	return 0;
}


#include<ctime>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
#include<unordered_map>
#define M 400010
#define rt register int
#define l putchar('\n')
#define ll long long
#define r read()
using namespace std;
namespace fast_IO
{
    const int IN_LEN=10000000,OUT_LEN=10000000;
    char ibuf[IN_LEN],obuf[OUT_LEN],*ih=ibuf+IN_LEN,*oh=obuf,*lastin=ibuf+IN_LEN,*lastout=obuf+OUT_LEN-1;
    inline char getchar_(){return (ih==lastin)&&(lastin=(ih=ibuf)+fread(ibuf,1,IN_LEN,stdin),ih==lastin)?EOF:*ih++;}
}
using namespace fast_IO;
#define getchar() getchar_()
inline int read(){
    register int x = 0;char ch;
    while (!isdigit(ch)) ch = getchar();
    while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar(); return x;
}
void write(ll y){if(y<0)putchar('-'),y=-y;if(y>9)write(y/10);putchar(y%10+48);}
void writeln(const ll y){write(y);putchar('\n');}
int i,j,k,m,n,x,y,z,cnt;
unsigned ll A,B,C;
vector<int>a[M][2];
int to[M],F[M],L[M],N[M],du[M];
struct ed{
	int x,y;
}q[M];
void add(const int x,const int y){
	to[++k]=y;
	if(!F[x])F[x]=k;
	else N[L[x]]=k;
	L[x]=k;
}
bool pp[M];
inline unsigned ll calc(int x,int y,const int z){
	if(x>y)swap(x,y);
	return A*x+B*y+C*z;
}
unordered_map<ll,bool>s;
int main(){
	//freopen("girls.in","r",stdin);
    n=r;m=r;A=r,B=r,C=r;unsigned ll ans=0;
    for(rt i=0;i<n;i++){
    	ans+=A*((ll)(n-i-1)*(n-i-2)/2)*i;
    	ans+=B*i*(n-i-1)*i;
		ans+=C*((ll)i*(i-1)/2)*i;
	}
	for(rt i=1;i<=m;i++){
		x=r;y=r;if(x>y)swap(x,y);
		q[i].x=x;q[i].y=y;s[(ll)x*(n+1)+y]=1;
		add(x,y);du[x]++;du[y]++;
		a[x][1].push_back(y);a[y][0].push_back(x);
		ans-=(A*x+B*y)*(n-y-1)+C*((ll)(y+n)*(n-y-1)/2);
		ans-=(A*x+C*y)*(y-x-1)+B*((ll)(x+y)*(y-x-1)/2);
		ans-=(B*x+C*y)*x+A*((ll)(x-1)*x/2);
	}
	for(rt i=0;i<n;i++)sort(a[i][0].begin(),a[i][0].end()),sort(a[i][1].begin(),a[i][1].end());
	for(rt i=0;i<n;i++){
		int sz=a[i][0].size();
		if(sz>=2){
			ans+=C*i*((ll)sz*(sz-1)/2);
			int all=0;
			for(rt j=0;j<sz;j++)all+=a[i][0][j];
			for(rt j=0;j<sz;j++){
				all-=a[i][0][j];
				ans+=A*a[i][0][j]*(sz-j-1)+B*all;
			}
		}
		int sz2=a[i][1].size();
		if(sz2>=2){
			ans+=A*i*((ll)sz2*(sz2-1)/2);
			ll all=0;
			for(rt j=0;j<sz2;j++)all+=a[i][1][j];
			for(rt j=0;j<sz2;j++){
				all-=a[i][1][j];
				ans+=B*a[i][1][j]*(sz2-j-1)+C*all;
			}
		}
		if(sz&&sz2){
			ans+=B*i*sz*sz2;
			for(rt j=0;j<sz;j++)ans+=A*a[i][0][j]*sz2;
			for(rt j=0;j<sz2;j++)ans+=C*a[i][1][j]*sz;
		}
	}
	for(rt i=1;i<=m;i++){
		if(du[q[i].x]<du[q[i].y])x=q[i].x,y=q[i].y;else x=q[i].y,y=q[i].x;
		if(du[x]*4>du[y]){
			for(rt j=F[x];j;j=N[j])pp[to[j]]=1;
			for(rt j=F[y];j;j=N[j])if(pp[to[j]])ans-=calc(x,y,to[j]);
			for(rt j=F[x];j;j=N[j])pp[to[j]]=0;
			continue;
		}
		for(rt j=F[x];j;j=N[j])if(to[j]>y&&s[(ll)y*(n+1)+to[j]])ans-=calc(x,y,to[j]);

	}
	cout<<ans;
	return 0;
}


#include<ctime>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
#include<unordered_map>
#define M 400010
#define rt register int
#define l putchar('\n')
#define ll long long
#define r read()
using namespace std;
inline ll read(){
    register ll x = 0; char zf = 1; char ch;
    while (ch != '-' && !isdigit(ch)) ch = getchar();
    if (ch == '-') zf = -1, ch = getchar();
    while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar(); return x * zf;
}
void write(ll y){if(y<0)putchar('-'),y=-y;if(y>9)write(y/10);putchar(y%10+48);}
void writeln(const ll y){write(y);putchar('\n');}
int i,j,k,m,n,x,y,z,cnt;
unsigned ll A,B,C;
vector<int>a[M][2];
int to[M],F[M],L[M],N[M],du[M];
struct ed{
	int x,y;
}q[M];
void add(const int x,const int y){
	to[++k]=y;
	if(!F[x])F[x]=k;
	else N[L[x]]=k;
	L[x]=k;
}
bool pp[M];
ll calc(int x,int y,int z){
	if(x>y)swap(x,y);
	return A*x+B*y+C*z;
}
unordered_map<ll,bool>s;
int main(){
	freopen("girls.in","r",stdin);
    n=r;m=r;A=r,B=r,C=r;unsigned ll ans=0;
    for(rt i=0;i<n;i++){
    	ans+=A*((ll)(n-i-1)*(n-i-2)/2)*i;
    	ans+=B*i*(n-i-1)*i;
		ans+=C*((ll)i*(i-1)/2)*i;
	}
	for(rt i=1;i<=m;i++){
		x=r;y=r;if(x>y)swap(x,y);
		q[i].x=x;q[i].y=y;s[(ll)x*(n+1)+y]=1;
		add(x,y);add(y,x);du[x]++;du[y]++;
		a[x][1].push_back(y);a[y][0].push_back(x);
		ans-=(A*x+B*y)*(n-y-1)+C*((ll)(y+n)*(n-y-1)/2);
		ans-=(A*x+C*y)*(y-x-1)+B*((ll)(x+y)*(y-x-1)/2);
		ans-=(B*x+C*y)*x+A*((ll)(x-1)*x/2);
	}
	for(rt i=0;i<n;i++)sort(a[i][0].begin(),a[i][0].end()),sort(a[i][1].begin(),a[i][1].end());
	for(rt i=0;i<n;i++){
		int sz=a[i][0].size();
		if(sz>=2){
			ans+=C*i*((ll)sz*(sz-1)/2);
			int all=0;
			for(rt j=0;j<sz;j++)all+=a[i][0][j];
			for(rt j=0;j<sz;j++){
				all-=a[i][0][j];
				ans+=A*a[i][0][j]*(sz-j-1)+B*all;
			}
		}
		int sz2=a[i][1].size();
		if(sz2>=2){
			ans+=A*i*((ll)sz2*(sz2-1)/2);
			ll all=0;
			for(rt j=0;j<sz2;j++)all+=a[i][1][j];
			for(rt j=0;j<sz2;j++){
				all-=a[i][1][j];
				ans+=B*a[i][1][j]*(sz2-j-1)+C*all;
			}
		}
		if(sz&&sz2){
			ans+=B*i*sz*sz2;
			for(rt j=0;j<sz;j++)ans+=A*a[i][0][j]*sz2;
			for(rt j=0;j<sz2;j++)ans+=C*a[i][1][j]*sz;
		}
	}
	for(rt i=1;i<=m;i++){
		if(du[q[i].x]<du[q[i].y])x=q[i].x,y=q[i].y;else x=q[i].y,y=q[i].x;
		/*if(du[x]*5>du[y]){
			for(rt j=F[x];j;j=N[j])pp[to[j]]=1;
			for(rt j=F[y];j;j=N[j])if(pp[to[j]])ans-=calc(x,y,to[j]);
			for(rt j=F[x];j;j=N[j])pp[to[j]]=0;
			continue;
		}*/
		for(rt j=F[x];j;j=N[j])if(to[j]>max(x,y))if(s[(ll)y*(n+1)+to[j]])ans-=calc(x,y,to[j]);

	}
	cout<<ans;
	return 0;
}


#include<cstdio>
#include<iostream>
#include<cstring>
#include<cmath>
#include<cctype>
#include<algorithm>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define interesting int
const int N=2E5+10;
int n,m;
ull A,B,C;
ull ans=0;
ull f[N];
int g[N];
struct node{
	int a,b;
}p[N];
inline int cmp1(node x,node y){return x.a<y.a||(x.a==y.a&&x.b<y.b);}
inline int cmp2(node x,node y){return x.b>y.b||(x.b==y.b&&x.a>y.a);}
int hd[N],nxt[N<<1],to[N<<1],cnt;
inline void init(int x,int y){
	cnt++;
	nxt[cnt]=hd[x];
	hd[x]=cnt;
	to[cnt]=y;
}
int main()
{
//	printf("%llu",ans-11);
	scanf("%d%d%llu%llu%llu",&n,&m,&A,&B,&C);
	for(int i=0;i<n;i++){
		ans+=A*i*((ull)(n-i-1)*(n-i-2)/2);
		ans+=B*i*i*(n-i-1);
		ans+=C*i*((ull)i*(i-1)/2);
//		puts("soifgs");
	}
	for(int i=1;i<=m;i++){
		scanf("%d%d",&p[i].a,&p[i].b);
		if(p[i].a>p[i].b) swap(p[i].a,p[i].b);
		f[p[i].a]+=p[i].b;g[p[i].a]++;init(p[i].b,p[i].a);
		ans-=(A*p[i].a+B*p[i].b)*(n-1-p[i].b)+C*((ull)(n+p[i].b)*(n-1-p[i].b)/2);
		ans-=(A*p[i].a+C*p[i].b)*(p[i].b-p[i].a-1)+B*((ull)(p[i].a+p[i].b)*(p[i].b-p[i].a-1)/2);
		ans-=(B*p[i].a+C*p[i].b)*(p[i].a)+A*((ull)(p[i].a-1)*(p[i].a)/2);
	}
//	printf("%llu\n",ans);
	for(int i=1;i<=m;i++){
		ans+=(A*p[i].a+B*p[i].b)*g[p[i].b]+C*f[p[i].b];
//		ans+=(A*p[i].a+B*p[i].b)*p[p[i].b]+C*f[p[i].b];
	}
	sort(p+1,p+1+m,cmp1);
	ull res=p[1].b;int siz=1;
	for(int i=2;i<=m;i++){
		if(p[i].a!=p[i-1].a){
			res=p[i].b;
			siz=1;
		}
		else{
			ans+=(A*p[i].a+C*p[i].b)*siz+res*B;
			siz++;
			res+=p[i].b;
		}
	}
//	printf("%llu\n",ans);
	sort(p+1,p+1+m,cmp2);
	res=p[1].a;siz=1;
	for(int i=2;i<=m;i++){
		if(p[i].b!=p[i-1].b){
			res=p[i].a;
			siz=1;
		}
		else{
//			printf("%d %d %d\n",p[i].a,res,p[i].b);
			ans+=(A*p[i].a+C*p[i].b)*siz+res*B;
			siz++;
			res+=p[i].a;
		}
	}
//	printf("%llu\n",ans);
	for(int i=1;i<=n;i++){
		for(int j=hd[i];j;j=nxt[j]){
			int u=to[j];
			f[u]=1;
		}
		for(int j=hd[i];j;j=nxt[j]){
			int u=to[j];
			for(int k=hd[u];k;k=nxt[k]){
				int v=to[k];
				if(f[v]){
					ans-=A*v+B*u+C*i;
				}
			}
		}
		for(int j=hd[i];j;j=nxt[j]){
			int u=to[j];
			f[u]=0;
		}
	}
	printf("%llu\n",ans);
    return 0;
}


#include<ctime>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#define M 400010
#define rt register int
#define l putchar('\n')
#define ll long long
#define r read()
using namespace std;
inline ll read(){
    register ll x = 0; char zf = 1; char ch;
    while (ch != '-' && !isdigit(ch)) ch = getchar();
    if (ch == '-') zf = -1, ch = getchar();
    while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar(); return x * zf;
}
void write(ll y){if(y<0)putchar('-'),y=-y;if(y>9)write(y/10);putchar(y%10+48);}
void writeln(const ll y){write(y);putchar('\n');}
int i,j,k,m,n,x,y,z,cnt;
unsigned ll A,B,C;
vector<int>a[M][2];
int to[M],F[M],L[M],N[M],du[M];
struct ed{
	int x,y;
}q[M];
void add(const int x,const int y){
	to[++k]=y;
	if(!F[x])F[x]=k;
	else N[L[x]]=k;
	L[x]=k;
}
bool pp[M];
ll calc(int x,int y,int z){
	if(x>y)swap(x,y);
	if(y>z||x>z)return 0;
	return A*x+B*y+C*z;
}
int main(){
	//freopen("girls.in","r",stdin);
    n=r;m=r;A=r,B=r,C=r;unsigned ll ans=0;
    for(rt i=0;i<n;i++){
    	ans+=A*((ll)(n-i-1)*(n-i-2)/2)*i;
    	ans+=B*i*(n-i-1)*i;
		ans+=C*((ll)i*(i-1)/2)*i;
	}
	for(rt i=1;i<=m;i++){
		x=r;y=r;if(x>y)swap(x,y);
		q[i].x=x;q[i].y=y;
		add(x,y);add(y,x);du[x]++;du[y]++;
		a[x][1].push_back(y);a[y][0].push_back(x);
		ans-=(A*x+B*y)*(n-y-1)+C*((ll)(y+n)*(n-y-1)/2);
		ans-=(A*x+C*y)*(y-x-1)+B*((ll)(x+y)*(y-x-1)/2);
		ans-=(B*x+C*y)*x+A*((ll)(x-1)*x/2);
	}
	for(rt i=0;i<n;i++)sort(a[i][0].begin(),a[i][0].end()),sort(a[i][1].begin(),a[i][1].end());
	for(rt i=0;i<n;i++){
		int sz=a[i][0].size();
		if(sz>=2){
			ans+=C*i*((ll)sz*(sz-1)/2);
			int all=0;
			for(rt j=0;j<sz;j++)all+=a[i][0][j];
			for(rt j=0;j<sz;j++){
				all-=a[i][0][j];
				ans+=A*a[i][0][j]*(sz-j-1)+B*all;
			}
		}
		int sz2=a[i][1].size();
		if(sz2>=2){
			ans+=A*i*((ll)sz2*(sz2-1)/2);
			ll all=0;
			for(rt j=0;j<sz2;j++)all+=a[i][1][j];
			for(rt j=0;j<sz2;j++){
				all-=a[i][1][j];
				ans+=B*a[i][1][j]*(sz2-j-1)+C*all;
			}
		}
		if(sz&&sz2){
			ans+=B*i*sz*sz2;
			for(rt j=0;j<sz;j++)ans+=A*a[i][0][j]*sz2;
			for(rt j=0;j<sz2;j++)ans+=C*a[i][1][j]*sz;
		}
	}

	for(rt i=1;i<=m;i++){
		if(du[q[i].x]<du[q[i].y])x=q[i].x,y=q[i].y;else x=q[i].y,y=q[i].x;
		for(rt j=F[x];j;j=N[j])pp[to[j]]=1;
		for(rt j=F[y];j;j=N[j])if(pp[to[j]])ans-=calc(x,y,to[j]);
		for(rt j=F[x];j;j=N[j])pp[to[j]]=0;
	}
	cout<<ans;
	return 0;
}


#include<ctime>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
#include<unordered_map>
#define M 400010
#define rt register int
#define l putchar('\n')
#define ll long long
#define r read()
using namespace std;
inline ll read(){
    register ll x = 0; char zf = 1; char ch;
    while (ch != '-' && !isdigit(ch)) ch = getchar();
    if (ch == '-') zf = -1, ch = getchar();
    while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar(); return x * zf;
}
void write(ll y){if(y<0)putchar('-'),y=-y;if(y>9)write(y/10);putchar(y%10+48);}
void writeln(const ll y){write(y);putchar('\n');}
int i,j,k,m,n,x,y,z,cnt;
unsigned ll A,B,C;
vector<int>a[M][2];
int to[M],F[M],L[M],N[M],du[M];
struct ed{
	int x,y;
}q[M];
void add(const int x,const int y){
	to[++k]=y;
	if(!F[x])F[x]=k;
	else N[L[x]]=k;
	L[x]=k;
}
bool pp[M];
ll calc(int x,int y,int z){
	if(x>y)swap(x,y);
	return A*x+B*y+C*z;
}
unordered_map<ll,bool>s;
int main(){
	//freopen("girls.in","r",stdin);
    n=r;m=r;A=r,B=r,C=r;unsigned ll ans=0;
    for(rt i=0;i<n;i++){
    	ans+=A*((ll)(n-i-1)*(n-i-2)/2)*i;
    	ans+=B*i*(n-i-1)*i;
		ans+=C*((ll)i*(i-1)/2)*i;
	}
	for(rt i=1;i<=m;i++){
		x=r;y=r;if(x>y)swap(x,y);
		q[i].x=x;q[i].y=y;s[(ll)x*(n+1)+y]=1;
		add(x,y);du[x]++;du[y]++;
		a[x][1].push_back(y);a[y][0].push_back(x);
		ans-=(A*x+B*y)*(n-y-1)+C*((ll)(y+n)*(n-y-1)/2);
		ans-=(A*x+C*y)*(y-x-1)+B*((ll)(x+y)*(y-x-1)/2);
		ans-=(B*x+C*y)*x+A*((ll)(x-1)*x/2);
	}
	for(rt i=0;i<n;i++)sort(a[i][0].begin(),a[i][0].end()),sort(a[i][1].begin(),a[i][1].end());
	for(rt i=0;i<n;i++){
		int sz=a[i][0].size();
		if(sz>=2){
			ans+=C*i*((ll)sz*(sz-1)/2);
			int all=0;
			for(rt j=0;j<sz;j++)all+=a[i][0][j];
			for(rt j=0;j<sz;j++){
				all-=a[i][0][j];
				ans+=A*a[i][0][j]*(sz-j-1)+B*all;
			}
		}
		int sz2=a[i][1].size();
		if(sz2>=2){
			ans+=A*i*((ll)sz2*(sz2-1)/2);
			ll all=0;
			for(rt j=0;j<sz2;j++)all+=a[i][1][j];
			for(rt j=0;j<sz2;j++){
				all-=a[i][1][j];
				ans+=B*a[i][1][j]*(sz2-j-1)+C*all;
			}
		}
		if(sz&&sz2){
			ans+=B*i*sz*sz2;
			for(rt j=0;j<sz;j++)ans+=A*a[i][0][j]*sz2;
			for(rt j=0;j<sz2;j++)ans+=C*a[i][1][j]*sz;
		}
	}
	for(rt i=1;i<=m;i++){
		if(du[q[i].x]<du[q[i].y])x=q[i].x,y=q[i].y;else x=q[i].y,y=q[i].x;
		if(du[x]*5>du[y]){
			for(rt j=F[x];j;j=N[j])pp[to[j]]=1;
			for(rt j=F[y];j;j=N[j])if(pp[to[j]])ans-=calc(x,y,to[j]);
			for(rt j=F[x];j;j=N[j])pp[to[j]]=0;
			continue;
		}
		for(rt j=F[x];j;j=N[j])if(to[j]>max(x,y))if(s[(ll)y*(n+1)+to[j]])ans-=calc(x,y,to[j]);

	}
	cout<<ans;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long ull;

const int maxn = 200010;
const int sqr = 500;

ull ans = 0, sum[maxn], val[maxn], _val[maxn];

int n, m, A, B, C, e_u[maxn], e_v[maxn], deg[maxn];
vector<int> edge[maxn], lef[maxn], rig[maxn];
int vis[maxn];
vector<int> el[maxn];
vector<ull> sl[maxn];

int main() {
	scanf("%d%d", &n, &m);
	scanf("%d%d%d", &A, &B, &C);
	for (int i = 0; i < m; i++) {
		int u, v; scanf("%d%d", &u, &v);
		edge[u].push_back(v), edge[v].push_back(u);
		e_u[i] = u, e_v[i] = v;
	}
	for (int i = 0; i < n; i++) for (int j = 0; j < edge[i].size(); j++) if (edge[i][j] < i) val[i] += edge[i][j], _val[i] ++;
	for (int i = 1; i < n; i++) sum[i] = sum[i-1] + i;
	for (int i = 0; i < n; i++) ans += ull(1) * (n-i-1) * (n-i-2) / 2 * i * A + ull(1) * i * (n-i-1) * i * B + ull(1) * i * (i-1) / 2 * i * C;
	for (int u = 0; u < n; u++) {
		el[u] = edge[u];
		sort(el[u].begin(), el[u].end(), less<int>());
		sl[u] = vector<ull>(el[u].size()+1, 0);
		for (int i = int (el[u].size())-1; i >= 0; i--) {
			sl[u][i] = el[u][i] + sl[u][i+1];
		}
	}
	for (int i = 0; i < m; i++) {
		int u = e_u[i], v = e_v[i];
		if (u > v) swap(u, v);
		if (deg[u] >= sqr) rig[u].push_back(v);
		else lef[v].push_back(u);
	}
	for (int i = n-1; i >= 0; i--) {
		int r = i;
		for (int j = 0; j < edge[i].size(); j++) vis[edge[i][j]] = 1;
		for (int j = 0; j < lef[i].size(); j++) {
			int l = lef[i][j];
			// 边 [l, r]
			// u < l
			if (l) ans -= ull(1) * (sum[l-1] - val[l]) * A + (ull(1) * l * B + ull(1) * r * C) * (l - _val[l]);
			if (r < n-1) ans -= ull(1) * (sum[n-1] - sum[r]) * C + (ull(1) * l * A + ull(1) * r * B) * (n-1-r);
			if (l+1 < r) {
				// 首先是把交算两次要减去多少
				ull sub = 0;
				sub += ull(1) * B * (sl[l][lower_bound(el[l].begin(), el[l].end(), l+1) - el[l].begin()] - sl[l][upper_bound(el[l].begin(), el[l].end(), r-1) - el[l].begin()]);
				sub += ull(1) * B * (sl[r][lower_bound(el[r].begin(), el[r].end(), l+1) - el[r].begin()] - sl[r][upper_bound(el[r].begin(), el[r].end(), r-1) - el[r].begin()]);
				sub += ull(1) * (ull(1) * A * l + ull(1) * C * r) * (upper_bound(el[l].begin(), el[l].end(), r-1) - lower_bound(el[l].begin(), el[l].end(), l+1));
				sub += ull(1) * (ull(1) * A * l + ull(1) * C * r) * (upper_bound(el[r].begin(), el[r].end(), r-1) - lower_bound(el[r].begin(), el[r].end(), l+1));
				for (int k = 0; k < edge[l].size(); k++) {
					int v = edge[l][k];
					if (vis[v]) {
						sub -= ull(1) * A * l + ull(1) * B * v + ull(1) * C * r;
					}
				}
				ans -= (ull(1) * A * l + ull(1) * C * r) * (r-l-1) + ull(1) * B * (sum[r-1] - sum[l]) - sub;
			}
		}
		for (int j = 0; j < edge[i].size(); j++) vis[edge[i][j]] = 0;
	}
	for (int i = 0; i < n; i++) {
		int l = i;
		for (int j = 0; j < edge[i].size(); j++) vis[edge[i][j]] = 1;
		for (int j = 0; j < rig[i].size(); j++) {
			int r = rig[i][j];
			if (l) ans -= ull(1) * (sum[l-1] - val[l]) * A + (ull(1) * l * B + ull(1) * r * C) * (l - _val[l]);
			if (r < n-1) ans -= ull(1) * (sum[n-1] - sum[r]) * C + (ull(1) * l * A + ull(1) * r * B) * (n-1-r);
			if (l+1 < r) {
				ull sub = 0;
				sub += ull(1) * B * (sl[l][lower_bound(el[l].begin(), el[l].end(), l+1) - el[l].begin()] - sl[l][upper_bound(el[l].begin(), el[l].end(), r-1) - el[l].begin()]);
				sub += ull(1) * B * (sl[r][lower_bound(el[r].begin(), el[r].end(), l+1) - el[r].begin()] - sl[r][upper_bound(el[r].begin(), el[r].end(), r-1) - el[r].begin()]);
				sub += ull(1) * (ull(1) * A * l + ull(1) * C * r) * (upper_bound(el[l].begin(), el[l].end(), r-1) - lower_bound(el[l].begin(), el[l].end(), l+1));
				sub += ull(1) * (ull(1) * A * l + ull(1) * C * r) * (upper_bound(el[r].begin(), el[r].end(), r-1) - lower_bound(el[r].begin(), el[r].end(), l+1));
				for (int k = 0; k < edge[r].size(); k++) {
					int v = edge[r][k];
					sub -= ull(1) * A * l + ull(1) * B * v + ull(1) * C * r;
				}
				ans -= (ull(1) * A * l + ull(1) * C * r) * (r-l-1) + ull(1) * B * (sum[r-1] - sum[l]) - sub;
			}
		}
		for (int j = 0; j < edge[i].size(); j++) vis[edge[i][j]] = 0;
	}
	cout << ans << endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int maxn = 200010;
const int sqr = 500;

ll ans = 0, sum[maxn], val[maxn], _val[maxn];

int n, m, A, B, C, e_u[maxn], e_v[maxn], deg[maxn];
vector<int> edge[maxn], lef[maxn], rig[maxn];
int vis[maxn];
vector<int> el[maxn];
vector<ll> sl[maxn];

int main() {
	scanf("%d%d", &n, &m);
	scanf("%d%d%d", &A, &B, &C);
	for (int i = 0; i < m; i++) {
		int u, v; scanf("%d%d", &u, &v);
		edge[u].push_back(v), edge[v].push_back(u);
		e_u[i] = u, e_v[i] = v;
	}
	for (int i = 0; i < n; i++) for (int j = 0; j < edge[i].size(); j++) if (edge[i][j] < i) val[i] += edge[i][j], _val[i] ++;
	for (int i = 1; i < n; i++) sum[i] = sum[i-1] + i;
	for (int i = 0; i < n; i++) ans += 1LL * (n-i-1) * (n-i-2) / 2 * i * A + 1LL * i * (n-i-1) * i * B + 1LL * i * (i-1) / 2 * i * C;
	for (int u = 0; u < n; u++) {
		el[u] = edge[u];
		sort(el[u].begin(), el[u].end(), less<int>());
		sl[u] = vector<ll>(el[u].size()+1, 0);
		for (int i = int (el[u].size())-1; i >= 0; i--) {
			sl[u][i] = el[u][i] + sl[u][i+1];
		}
	}
	for (int i = 0; i < m; i++) {
		int u = e_u[i], v = e_v[i];
		if (u > v) swap(u, v);
		if (deg[u] >= sqr) rig[u].push_back(v);
		else lef[v].push_back(u);
	}
	for (int i = n-1; i >= 0; i--) {
		int r = i;
		for (int j = 0; j < edge[i].size(); j++) vis[edge[i][j]] = 1;
		for (int j = 0; j < lef[i].size(); j++) {
			int l = lef[i][j];
			// 边 [l, r]
			// u < l
			if (l) ans -= 1LL * (sum[l-1] - val[l]) * A + (1LL * l * B + 1LL * r * C) * (l - _val[l]);
			if (r < n-1) ans -= 1LL * (sum[n-1] - sum[r]) * C + (1LL * l * A + 1LL * r * B) * (n-1-r);
			if (l+1 < r) {
				// 首先是把交算两次要减去多少
				ll sub = 0;
				sub += 1LL * B * (sl[l][lower_bound(el[l].begin(), el[l].end(), l+1) - el[l].begin()] - sl[l][upper_bound(el[l].begin(), el[l].end(), r-1) - el[l].begin()]);
				sub += 1LL * B * (sl[r][lower_bound(el[r].begin(), el[r].end(), l+1) - el[r].begin()] - sl[r][upper_bound(el[r].begin(), el[r].end(), r-1) - el[r].begin()]);
				sub += 1LL * (1LL * A * l + 1LL * C * r) * (upper_bound(el[l].begin(), el[l].end(), r-1) - lower_bound(el[l].begin(), el[l].end(), l+1));
				sub += 1LL * (1LL * A * l + 1LL * C * r) * (upper_bound(el[r].begin(), el[r].end(), r-1) - lower_bound(el[r].begin(), el[r].end(), l+1));
				for (int k = 0; k < edge[l].size(); k++) {
					int v = edge[l][k];
					if (vis[v]) {
						sub -= 1LL * A * l + 1LL * B * v + 1LL * C * r;
					}
				}
				ans -= (1LL * A * l + 1LL * C * r) * (r-l-1) + 1LL * B * (sum[r-1] - sum[l]) - sub;
			}
		}
		for (int j = 0; j < edge[i].size(); j++) vis[edge[i][j]] = 0;
	}
	for (int i = 0; i < n; i++) {
		int l = i;
		for (int j = 0; j < edge[i].size(); j++) vis[edge[i][j]] = 1;
		for (int j = 0; j < rig[i].size(); j++) {
			int r = rig[i][j];
			if (l) ans -= 1LL * (sum[l-1] - val[l]) * A + (1LL * l * B + 1LL * r * C) * (l - _val[l]);
			if (r < n-1) ans -= 1LL * (sum[n-1] - sum[r]) * C + (1LL * l * A + 1LL * r * B) * (n-1-r);
			if (l+1 < r) {
				ll sub = 0;
				sub += 1LL * B * (sl[l][lower_bound(el[l].begin(), el[l].end(), l+1) - el[l].begin()] - sl[l][upper_bound(el[l].begin(), el[l].end(), r-1) - el[l].begin()]);
				sub += 1LL * B * (sl[r][lower_bound(el[r].begin(), el[r].end(), l+1) - el[r].begin()] - sl[r][upper_bound(el[r].begin(), el[r].end(), r-1) - el[r].begin()]);
				sub += 1LL * (1LL * A * l + 1LL * C * r) * (upper_bound(el[l].begin(), el[l].end(), r-1) - lower_bound(el[l].begin(), el[l].end(), l+1));
				sub += 1LL * (1LL * A * l + 1LL * C * r) * (upper_bound(el[r].begin(), el[r].end(), r-1) - lower_bound(el[r].begin(), el[r].end(), l+1));
				for (int k = 0; k < edge[r].size(); k++) {
					int v = edge[r][k];
					sub -= 1LL * A * l + 1LL * B * v + 1LL * C * r;
				}
				ans -= (1LL * A * l + 1LL * C * r) * (r-l-1) + 1LL * B * (sum[r-1] - sum[l]) - sub;
			}
		}
		for (int j = 0; j < edge[i].size(); j++) vis[edge[i][j]] = 0;
	}
	printf("%lld\n", ans);
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long ull;

const int maxn = 200010;
const int sqr = 500;

ull ans = 0, sum[maxn], val[maxn], _val[maxn];

int n, m, A, B, C, e_u[maxn], e_v[maxn], deg[maxn];
vector<int> edge[maxn], lef[maxn], rig[maxn];
int vis[maxn];
vector<int> el[maxn];
vector<ull> sl[maxn];

int main() {
	scanf("%d%d", &n, &m);
	scanf("%d%d%d", &A, &B, &C);
	for (int i = 0; i < m; i++) {
		int u, v; scanf("%d%d", &u, &v);
		edge[u].push_back(v), edge[v].push_back(u);
		e_u[i] = u, e_v[i] = v;
	}
	for (int i = 0; i < n; i++) for (int j = 0; j < edge[i].size(); j++) if (edge[i][j] < i) val[i] += edge[i][j], _val[i] ++;
	for (int i = 1; i < n; i++) sum[i] = sum[i-1] + i;
	for (int i = 0; i < n; i++) ans += ull(1) * (n-i-1) * (n-i-2) / 2 * i * A + ull(1) * i * (n-i-1) * i * B + ull(1) * i * (i-1) / 2 * i * C;
	for (int u = 0; u < n; u++) {
		el[u] = edge[u];
		sort(el[u].begin(), el[u].end(), less<int>());
		sl[u] = vector<ull>(el[u].size()+1, 0);
		for (int i = int (el[u].size())-1; i >= 0; i--) {
			sl[u][i] = el[u][i] + sl[u][i+1];
		}
	}
	for (int i = 0; i < m; i++) {
		int u = e_u[i], v = e_v[i];
		if (u > v) swap(u, v);
		if (deg[u] >= sqr) rig[u].push_back(v);
		else lef[v].push_back(u);
	}
	for (int i = n-1; i >= 0; i--) {
		int r = i;
		for (int j = 0; j < edge[i].size(); j++) vis[edge[i][j]] = 1;
		for (int j = 0; j < lef[i].size(); j++) {
			int l = lef[i][j];
			// 边 [l, r]
			// u < l
			if (l) ans -= ull(1) * (sum[l-1] - val[l]) * A + (ull(1) * l * B + ull(1) * r * C) * (l - _val[l]);
			if (r < n-1) ans -= ull(1) * (sum[n-1] - sum[r]) * C + (ull(1) * l * A + ull(1) * r * B) * (n-1-r);
			if (l+1 < r) {
				// 首先是把交算两次要减去多少
				ull sub = 0;
				sub += ull(1) * B * (sl[l][lower_bound(el[l].begin(), el[l].end(), l+1) - el[l].begin()] - sl[l][upper_bound(el[l].begin(), el[l].end(), r-1) - el[l].begin()]);
				sub += ull(1) * B * (sl[r][lower_bound(el[r].begin(), el[r].end(), l+1) - el[r].begin()] - sl[r][upper_bound(el[r].begin(), el[r].end(), r-1) - el[r].begin()]);
				sub += ull(1) * (ull(1) * A * l + ull(1) * C * r) * (upper_bound(el[l].begin(), el[l].end(), r-1) - lower_bound(el[l].begin(), el[l].end(), l+1));
				sub += ull(1) * (ull(1) * A * l + ull(1) * C * r) * (upper_bound(el[r].begin(), el[r].end(), r-1) - lower_bound(el[r].begin(), el[r].end(), l+1));
				for (int k = 0; k < edge[l].size(); k++) {
					int v = edge[l][k];
					if (vis[v] && v > l && v < r) sub -= ull(1) * A * l + ull(1) * B * v + ull(1) * C * r;
				}
				ans -= (ull(1) * A * l + ull(1) * C * r) * (r-l-1) + ull(1) * B * (sum[r-1] - sum[l]) - sub;
			}
		}
		for (int j = 0; j < edge[i].size(); j++) vis[edge[i][j]] = 0;
	}
	for (int i = 0; i < n; i++) {
		int l = i;
		for (int j = 0; j < edge[i].size(); j++) vis[edge[i][j]] = 1;
		for (int j = 0; j < rig[i].size(); j++) {
			int r = rig[i][j];
			if (l) ans -= ull(1) * (sum[l-1] - val[l]) * A + (ull(1) * l * B + ull(1) * r * C) * (l - _val[l]);
			if (r < n-1) ans -= ull(1) * (sum[n-1] - sum[r]) * C + (ull(1) * l * A + ull(1) * r * B) * (n-1-r);
			if (l+1 < r) {
				ull sub = 0;
				sub += ull(1) * B * (sl[l][lower_bound(el[l].begin(), el[l].end(), l+1) - el[l].begin()] - sl[l][upper_bound(el[l].begin(), el[l].end(), r-1) - el[l].begin()]);
				sub += ull(1) * B * (sl[r][lower_bound(el[r].begin(), el[r].end(), l+1) - el[r].begin()] - sl[r][upper_bound(el[r].begin(), el[r].end(), r-1) - el[r].begin()]);
				sub += ull(1) * (ull(1) * A * l + ull(1) * C * r) * (upper_bound(el[l].begin(), el[l].end(), r-1) - lower_bound(el[l].begin(), el[l].end(), l+1));
				sub += ull(1) * (ull(1) * A * l + ull(1) * C * r) * (upper_bound(el[r].begin(), el[r].end(), r-1) - lower_bound(el[r].begin(), el[r].end(), l+1));
				for (int k = 0; k < edge[r].size(); k++) {
					int v = edge[r][k];
					if (vis[v] && v > l && v < r) sub -= ull(1) * A * l + ull(1) * B * v + ull(1) * C * r;
				}
				ans -= (ull(1) * A * l + ull(1) * C * r) * (r-l-1) + ull(1) * B * (sum[r-1] - sum[l]) - sub;
			}
		}
		for (int j = 0; j < edge[i].size(); j++) vis[edge[i][j]] = 0;
	}
	cout << ans << endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long ull;

const int maxn = 200010;
const int sqr = 500;

ull ans = 0, sum[maxn], val[maxn], _val[maxn];

int n, m, A, B, C, e_u[maxn], e_v[maxn], deg[maxn];
vector<int> edge[maxn], lef[maxn], rig[maxn];
int vis[maxn];
vector<int> el[maxn];
vector<ull> sl[maxn];

int main() {
	scanf("%d%d", &n, &m);
	scanf("%d%d%d", &A, &B, &C);
	for (int i = 0; i < m; i++) {
		int u, v; scanf("%d%d", &u, &v);
		edge[u].push_back(v), edge[v].push_back(u);
		e_u[i] = u, e_v[i] = v;
	}
	for (int i = 0; i < n; i++) for (int j = 0; j < edge[i].size(); j++) if (edge[i][j] < i) val[i] += edge[i][j], _val[i] ++;
	for (int i = 1; i < n; i++) sum[i] = sum[i-1] + i;
	for (int i = 0; i < n; i++) ans += ull(1) * (n-i-1) * (n-i-2) / 2 * i * A + ull(1) * i * (n-i-1) * i * B + ull(1) * i * (i-1) / 2 * i * C;
	for (int u = 0; u < n; u++) {
		el[u] = edge[u];
		sort(el[u].begin(), el[u].end(), less<int>());
		sl[u] = vector<ll>(el[u].size()+1, 0);
		for (int i = int (el[u].size())-1; i >= 0; i--) {
			sl[u][i] = el[u][i] + sl[u][i+1];
		}
	}
	for (int i = 0; i < m; i++) {
		int u = e_u[i], v = e_v[i];
		if (u > v) swap(u, v);
		if (deg[u] >= sqr) rig[u].push_back(v);
		else lef[v].push_back(u);
	}
	for (int i = n-1; i >= 0; i--) {
		int r = i;
		for (int j = 0; j < edge[i].size(); j++) vis[edge[i][j]] = 1;
		for (int j = 0; j < lef[i].size(); j++) {
			int l = lef[i][j];
			// 边 [l, r]
			// u < l
			if (l) ans -= ull(1) * (sum[l-1] - val[l]) * A + (ull(1) * l * B + ull(1) * r * C) * (l - _val[l]);
			if (r < n-1) ans -= ull(1) * (sum[n-1] - sum[r]) * C + (ull(1) * l * A + ull(1) * r * B) * (n-1-r);
			if (l+1 < r) {
				// 首先是把交算两次要减去多少
				ull sub = 0;
				sub += ull(1) * B * (sl[l][lower_bound(el[l].begin(), el[l].end(), l+1) - el[l].begin()] - sl[l][upper_bound(el[l].begin(), el[l].end(), r-1) - el[l].begin()]);
				sub += ull(1) * B * (sl[r][lower_bound(el[r].begin(), el[r].end(), l+1) - el[r].begin()] - sl[r][upper_bound(el[r].begin(), el[r].end(), r-1) - el[r].begin()]);
				sub += ull(1) * (ull(1) * A * l + ull(1) * C * r) * (upper_bound(el[l].begin(), el[l].end(), r-1) - lower_bound(el[l].begin(), el[l].end(), l+1));
				sub += ull(1) * (ull(1) * A * l + ull(1) * C * r) * (upper_bound(el[r].begin(), el[r].end(), r-1) - lower_bound(el[r].begin(), el[r].end(), l+1));
				for (int k = 0; k < edge[l].size(); k++) {
					int v = edge[l][k];
					if (vis[v]) {
						sub -= ull(1) * A * l + ull(1) * B * v + ull(1) * C * r;
					}
				}
				ans -= (ull(1) * A * l + ull(1) * C * r) * (r-l-1) + ull(1) * B * (sum[r-1] - sum[l]) - sub;
			}
		}
		for (int j = 0; j < edge[i].size(); j++) vis[edge[i][j]] = 0;
	}
	for (int i = 0; i < n; i++) {
		int l = i;
		for (int j = 0; j < edge[i].size(); j++) vis[edge[i][j]] = 1;
		for (int j = 0; j < rig[i].size(); j++) {
			int r = rig[i][j];
			if (l) ans -= ull(1) * (sum[l-1] - val[l]) * A + (ull(1) * l * B + ull(1) * r * C) * (l - _val[l]);
			if (r < n-1) ans -= ull(1) * (sum[n-1] - sum[r]) * C + (ull(1) * l * A + ull(1) * r * B) * (n-1-r);
			if (l+1 < r) {
				ull sub = 0;
				sub += ull(1) * B * (sl[l][lower_bound(el[l].begin(), el[l].end(), l+1) - el[l].begin()] - sl[l][upper_bound(el[l].begin(), el[l].end(), r-1) - el[l].begin()]);
				sub += ull(1) * B * (sl[r][lower_bound(el[r].begin(), el[r].end(), l+1) - el[r].begin()] - sl[r][upper_bound(el[r].begin(), el[r].end(), r-1) - el[r].begin()]);
				sub += ull(1) * (ull(1) * A * l + ull(1) * C * r) * (upper_bound(el[l].begin(), el[l].end(), r-1) - lower_bound(el[l].begin(), el[l].end(), l+1));
				sub += ull(1) * (ull(1) * A * l + ull(1) * C * r) * (upper_bound(el[r].begin(), el[r].end(), r-1) - lower_bound(el[r].begin(), el[r].end(), l+1));
				for (int k = 0; k < edge[r].size(); k++) {
					int v = edge[r][k];
					sub -= ull(1) * A * l + ull(1) * B * v + ull(1) * C * r;
				}
				ans -= (ull(1) * A * l + ull(1) * C * r) * (r-l-1) + ull(1) * B * (sum[r-1] - sum[l]) - sub;
			}
		}
		for (int j = 0; j < edge[i].size(); j++) vis[edge[i][j]] = 0;
	}
	cout << ans << endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long ull;

const int maxn = 200010;
const int sqr = 500;

ull ans = 0, sum[maxn], val[maxn], _val[maxn];

int n, m, A, B, C, e_u[maxn], e_v[maxn], deg[maxn];
vector<int> edge[maxn], lef[maxn], rig[maxn];
int vis[maxn];
vector<int> el[maxn];
vector<ull> sl[maxn];

int main() {
	scanf("%d%d", &n, &m);
	scanf("%d%d%d", &A, &B, &C);
	for (int i = 0; i < m; i++) {
		int u, v; scanf("%d%d", &u, &v);
		edge[u].push_back(v), edge[v].push_back(u);
		e_u[i] = u, e_v[i] = v;
	}
	for (int i = 0; i < n; i++) for (int j = 0; j < edge[i].size(); j++) if (edge[i][j] < i) val[i] += edge[i][j], _val[i] ++;
	for (int i = 1; i < n; i++) sum[i] = sum[i-1] + i;
	for (int i = 0; i < n; i++) ans += ull(1) * (n-i-1) * (n-i-2) / 2 * i * A + ull(1) * i * (n-i-1) * i * B + ull(1) * i * (i-1) / 2 * i * C;
	for (int u = 0; u < n; u++) {
		el[u] = edge[u];
		sort(el[u].begin(), el[u].end(), less<int>());
		sl[u] = vector<ull>(el[u].size()+1, 0);
		for (int i = int (el[u].size())-1; i >= 0; i--) {
			sl[u][i] = el[u][i] + sl[u][i+1];
		}
	}
	for (int i = 0; i < m; i++) {
		int u = e_u[i], v = e_v[i];
		if (u > v) swap(u, v);
		if (deg[u] >= sqr) rig[u].push_back(v);
		else lef[v].push_back(u);
	}
	for (int i = n-1; i >= 0; i--) {
		int r = i;
		for (int j = 0; j < edge[i].size(); j++) vis[edge[i][j]] = 1;
		for (int j = 0; j < lef[i].size(); j++) {
			int l = lef[i][j];
			// 边 [l, r]
			// u < l
			if (l) ans -= ull(1) * (sum[l-1] - val[l]) * A + (ull(1) * l * B + ull(1) * r * C) * (l - _val[l]);
			if (r < n-1) ans -= ull(1) * (sum[n-1] - sum[r]) * C + (ull(1) * l * A + ull(1) * r * B) * (n-1-r);
			if (l+1 < r) {
				// 首先是把交算两次要减去多少
				ull sub = 0;
				sub += ull(1) * B * (sl[l][lower_bound(el[l].begin(), el[l].end(), l+1) - el[l].begin()] - sl[l][upper_bound(el[l].begin(), el[l].end(), r-1) - el[l].begin()]);
				sub += ull(1) * B * (sl[r][lower_bound(el[r].begin(), el[r].end(), l+1) - el[r].begin()] - sl[r][upper_bound(el[r].begin(), el[r].end(), r-1) - el[r].begin()]);
				sub += ull(1) * (ull(1) * A * l + ull(1) * C * r) * (upper_bound(el[l].begin(), el[l].end(), r-1) - lower_bound(el[l].begin(), el[l].end(), l+1));
				sub += ull(1) * (ull(1) * A * l + ull(1) * C * r) * (upper_bound(el[r].begin(), el[r].end(), r-1) - lower_bound(el[r].begin(), el[r].end(), l+1));
				for (int k = 0; k < edge[l].size(); k++) {
					int v = edge[l][k];
					if (vis[v]) sub -= ull(1) * A * l + ull(1) * B * v + ull(1) * C * r;
				}
				ans -= (ull(1) * A * l + ull(1) * C * r) * (r-l-1) + ull(1) * B * (sum[r-1] - sum[l]) - sub;
			}
		}
		for (int j = 0; j < edge[i].size(); j++) vis[edge[i][j]] = 0;
	}
	for (int i = 0; i < n; i++) {
		int l = i;
		for (int j = 0; j < edge[i].size(); j++) vis[edge[i][j]] = 1;
		for (int j = 0; j < rig[i].size(); j++) {
			int r = rig[i][j];
			if (l) ans -= ull(1) * (sum[l-1] - val[l]) * A + (ull(1) * l * B + ull(1) * r * C) * (l - _val[l]);
			if (r < n-1) ans -= ull(1) * (sum[n-1] - sum[r]) * C + (ull(1) * l * A + ull(1) * r * B) * (n-1-r);
			if (l+1 < r) {
				ull sub = 0;
				sub += ull(1) * B * (sl[l][lower_bound(el[l].begin(), el[l].end(), l+1) - el[l].begin()] - sl[l][upper_bound(el[l].begin(), el[l].end(), r-1) - el[l].begin()]);
				sub += ull(1) * B * (sl[r][lower_bound(el[r].begin(), el[r].end(), l+1) - el[r].begin()] - sl[r][upper_bound(el[r].begin(), el[r].end(), r-1) - el[r].begin()]);
				sub += ull(1) * (ull(1) * A * l + ull(1) * C * r) * (upper_bound(el[l].begin(), el[l].end(), r-1) - lower_bound(el[l].begin(), el[l].end(), l+1));
				sub += ull(1) * (ull(1) * A * l + ull(1) * C * r) * (upper_bound(el[r].begin(), el[r].end(), r-1) - lower_bound(el[r].begin(), el[r].end(), l+1));
				for (int k = 0; k < edge[r].size(); k++) {
					int v = edge[r][k];
					if (vis[v]) sub -= ull(1) * A * l + ull(1) * B * v + ull(1) * C * r;
				}
				ans -= (ull(1) * A * l + ull(1) * C * r) * (r-l-1) + ull(1) * B * (sum[r-1] - sum[l]) - sub;
			}
		}
		for (int j = 0; j < edge[i].size(); j++) vis[edge[i][j]] = 0;
	}
	cout << ans << endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

/*/
total - (i, j) - (i, k) - (j, k) + (i, j, k) /*/
const int N = 2e5 + 2;

int n, m;
unsigned long long a, b, c, sqr;
unsigned long long total;
vector<int>g[N];

pair<int, int>e[N];

int id_spec[N];
bitset<N>are[700];
unsigned long long comb2(int x) {
    return 1LL * x * (x - 1) / 2;
}

unsigned long long gaussum(int x) {
    return 1LL * x * (x + 1) / 2;
}
vector<int>gin[N];
unsigned long long gaussum(int i, int j) {
    if(i > j)
        return 0 ;
    return gaussum(j) - gaussum(i - 1);
}
int main() {
#ifndef ONLINE_JUDGE
    freopen("data.in", "r", stdin);
#endif // ONLINE_JUDGE

    cin >> n >> m >> a >> b >> c;
    sqr = sqrt(m) + 1;
    for(int i = 0;  i < m; ++i) {
        int na, nb;
        cin >> na >> nb;
        if(na > nb)
            swap(na, nb);
        g[na].push_back(nb);
        gin[nb].push_back(na);
        assert(na < nb);
        e[i] = make_pair(na, nb);
    }

    for(int i = 0; i < n; ++i)
        sort(g[i].begin(), g[i].end());

    for(int i = 0; i < n; ++i) {
        total += i * a * comb2(n - i - 1);
        total += 1LL * (n - i - 1) * i * b * i;
        total += comb2(i) * i * c;
    }

    // acum scad unde exista (i, j) perechea

    for(int i = 0; i < n; ++i) {
        for(auto j : g[i]) {
            if(j == n - 1)
                continue;
            total -= (1LL * a * i + 1LL * b * j) * (n - j - 1);
            total -= gaussum(j + 1, n - 1) * c;
        }
        long long s2 = 0;
        for(auto k : g[i]) {
            if(k != i + 1) {
                total -= (1LL * a * i + 1LL * c * k) * (k - i - 1);
                total -= gaussum(i + 1, k - 1) * b;
            }
        }
    }
    for(int j = 0; j < n; ++j) {
        for(auto k : g[j]) {
            if(!j)
                continue;
            total -= (1LL * b * j + 1LL * c * k) * j;
            total -= gaussum(0, j - 1) * a;
        }
    }
    //adun unde am si pe i, j si pe i, k
    // sau pe i, j si j, k
    // sau pe i, k si j, k

    for(int i = 0; i < n; ++i) {
        long long sumj = 0, am = 0;
        for(int k : g[i]) {
            if(am) {
                total += sumj * b;
                total += am * (1LL * i * a + 1LL * k * c);
            }
            ++am;
            sumj += k;
        }
    }

    // i, j si j, k

    for(int j = 0; j < n; ++j) {
        int nrp = gin[j].size() * g[j].size();
        long long sum_gout = 0;
        for(int k : g[j])
            sum_gout += k;
        for(int i : gin[j]) {
            total += (1LL * i + 1LL * j * b) * g[j].size();
            total += sum_gout * c;
        }
    }

    // i, k si j, k
    // adica fixez pe k

    for(int k = 0; k < n; ++k) {
        long long sum_i = 0, am = 0;
        for(int j : gin[k]) {
            if(am) {
                total += (1LL * k * c + 1LL * b * j) * am;
                total += sum_i * a;
            }
            ++am;
            sum_i += j;
        }
    }
sqr = sqrt(m) + 1;
    // calculez triunghiurile

    int am_spec = 0;
    for(int i = 0; i < n; ++i)
        if(g[i].size() >= sqr) {
            id_spec[i] = am_spec, ++am_spec;
        } else
            id_spec[i] = -1;
    for(int i = 0; i < m; ++i) {
        int ea, eb;
        tie(ea, eb) = e[i];

        int id_ea = id_spec[ea], id_eb = id_spec[eb];assert(ea < eb);

        if(g[ea].size() >= sqr) {
            are[id_ea][eb] = 1;
        }

    }
    for(int i = 0; i < n; ++i) {
        if(g[i].size() >= sqr) {
            int id_i = id_spec[i];
            for(int j = 0; j < m; ++j) {
                int ea, eb;
                tie(ea, eb) = e[j];
                if(are[id_i][ea] && are[id_i][eb]) {
                    total -= 1LL * a * i + 1LL * b * ea + 1LL * c * eb;
                }
            }
        }

        else {
            for(int j : g[i]) {
                int ptr_j = 0;
                for(int k : g[i]) {
                    if(j > k) continue;
                    if(g[j].size() < sqr) {
                        while(ptr_j < (int)g[j].size() && g[j][ptr_j] < k)
                            ++ ptr_j;
                        if(ptr_j != (int)g[j].size() && g[j][ptr_j] == k)
                            total -= 1LL * a * i + 1LL * b * j + 1LL * c * k;
                    }

                    else {
                        int id_j = id_spec[j];
                        if(are[id_j][k])
                            total -= 1LL * a * i + 1LL * b * j + 1LL * c * k;
                    }
                }
            }
        }
    }

cout << total;
}


#include <bits/stdc++.h>

using namespace std;

/*/
total - (i, j) - (i, k) - (j, k) + (i, j, k) /*/
const int N = 2e5 + 2;

int n, m;
unsigned long long a, b, c, sqr;
unsigned long long total;
vector<int>g[N];

pair<int, int>e[N];

int id_spec[N];
bitset<N>are[2000];
unsigned long long comb2(unsigned long long x) {
    return 1LL * x * (x - 1) / 2;
}

unsigned long long gaussum(unsigned long long x) {
    return  x * (x + 1) / 2;
}
vector<int>gin[N];
unsigned long long gaussum(int i, int j) {
    if(i > j)
        return 0 ;
    return gaussum(j) - gaussum(i - 1);
}
int main() {
#ifndef ONLINE_JUDGE
    freopen("data.in", "r", stdin);
#endif // ONLINE_JUDGE

    cin >> n >> m >> a >> b >> c;
    sqr = 1000;
    for(int i = 0;  i < m; ++i) {
        int na, nb;
        cin >> na >> nb;
        if(na > nb)
            swap(na, nb);
        g[na].push_back(nb);
        gin[nb].push_back(na);
        assert(na < nb);
        e[i] = make_pair(na, nb);
    }

    for(int i = 0; i < n; ++i)
        sort(g[i].begin(), g[i].end()), sort(gin[i].begin(), gin[i].end());

    for(int i = 0; i < n; ++i) {
        total += i * a * comb2(n - i - 1);
        total += b* (n - i - 1) * i * i;
        total += comb2(i) * i * c;
    }

    // acum scad unde exista (i, j) perechea

    for(int i = 0; i < n; ++i) {
        for(auto j : g[i]) {
            if(j == n - 1)
                continue;
            total -= (a * i + b * j) * (n - j - 1);
            total -= gaussum(j + 1, n - 1) * c;
        }
        unsigned long long s2 = 0;
        for(auto k : g[i]) {
            if(k != i + 1) {
                total -= ( a * i +  c * k) * (k - i - 1);
                total -= gaussum(i + 1, k - 1) * b;
            }
        }
    }
    for(int j = 0; j < n; ++j) {
        for(auto k : g[j]) {
            if(!j)
                continue;
            total -= (b * j  +c * k) * j;
            total -= gaussum(0, j - 1) * a;
        }
    }
    //adun unde am si pe i, j si pe i, k
    // sau pe i, j si j, k
    // sau pe i, k si j, k

    for(int i = 0; i < n; ++i) {
        unsigned long long sumj = 0, am = 0;
        for(int k : g[i]) {
            if(am) {
                total += sumj * b;
                total += am * (i * a +  k * c);
            }
            ++am;
            sumj += k;
        }
    }

    // i, j si j, k

    for(int j = 0; j < n; ++j) {
        int nrp = gin[j].size() * g[j].size();
        unsigned long long sum_gout = 0;
        for(int k : g[j])
            sum_gout += k;
        for(int i : gin[j]) {
            total += (1LL * i + 1ULL * j * b) * g[j].size();
            total += sum_gout * c;
        }
    }

    // i, k si j, k
    // adica fixez pe k

    for(int k = 0; k < n; ++k) {
        long long sum_i = 0, am = 0;
        for(int j : gin[k]) {
            if(am) {
                total += (1ULL * k * c + 1ULL * b * j) * am;
                total += sum_i * a;
            }
            ++am;
            sum_i += j;
        }
    }
sqr = m+1;
    // calculez triunghiurile

    int am_spec = 0;
    for(int i = 0; i < n; ++i)
        if(g[i].size() >= sqr) {
            id_spec[i] = am_spec, ++am_spec;
        } else
            id_spec[i] = -1;
    for(int i = 0; i < m; ++i) {
        int ea, eb;
        tie(ea, eb) = e[i];

        int id_ea = id_spec[ea], id_eb = id_spec[eb];assert(ea < eb);

        if(g[ea].size() >= sqr) {
            are[id_ea][eb] = 1;
        }

    }
    for(int i = 0; i < n; ++i) {
        if(g[i].size() >= sqr) {
            int id_i = id_spec[i];
            for(int j = 0; j < m; ++j) {
                int ea, eb;
                tie(ea, eb) = e[j];
                if(are[id_i][ea] && are[id_i][eb]) {
                    total -= 1ULL * a * i + 1ULL * b * ea + 1ULL * c * eb;
                }
            }
        }

        else {
            for(int j : g[i]) {
                int ptr_j = 0;
                for(int k : g[i]) {
                    if(j > k) continue;
                    if(g[j].size() < sqr) {
                        while(ptr_j < (int)g[j].size() && g[j][ptr_j] < k)
                            ++ ptr_j;
                        if(ptr_j != (int)g[j].size() && g[j][ptr_j] == k)
                            total -= 1ULL * a * i +  b * j + c * k;
                    }

                    else {
                        int id_j = id_spec[j];
                        if(are[id_j][k])
                            total -= a * i + b * j +  c * k;
                    }
                }
            }
        }
    }

cout << total;
}


#include <bits/stdc++.h>

using namespace std;

/*/
total - (i, j) - (i, k) - (j, k) + (i, j, k) /*/
const int N = 2e5 + 2;

int n, m;
unsigned long long a, b, c, sqr;
unsigned long long total;
vector<int>g[N];

pair<int, int>e[N];

int id_spec[N];
bitset<N>are[2000];
unsigned long long comb2(unsigned long long x) {
    return 1LL * x * (x - 1) / 2;
}

unsigned long long gaussum(unsigned long long x) {
    return  x * (x + 1) / 2;
}
vector<int>gin[N];
unsigned long long gaussum(int i, int j) {
    if(i > j)
        return 0 ;
    return gaussum(j) - gaussum(i - 1);
}
int main() {
#ifndef ONLINE_JUDGE
    freopen("data.in", "r", stdin);
#endif // ONLINE_JUDGE

    cin >> n >> m >> a >> b >> c;
    sqr = 1000;
    for(int i = 0;  i < m; ++i) {
        int na, nb;
        cin >> na >> nb;
        if(na > nb)
            swap(na, nb);
        g[na].push_back(nb);
        gin[nb].push_back(na);
        assert(na < nb);
        e[i] = make_pair(na, nb);
    }

    for(int i = 0; i < n; ++i)
        sort(g[i].begin(), g[i].end());

    for(int i = 0; i < n; ++i) {
        total += i * a * comb2(n - i - 1);
        total += b* (n - i - 1) * i * i;
        total += comb2(i) * i * c;
    }

    // acum scad unde exista (i, j) perechea

    for(int i = 0; i < n; ++i) {
        for(auto j : g[i]) {
            if(j == n - 1)
                continue;
            total -= (1LL * a * i + 1LL * b * j) * (n - j - 1);
            total -= gaussum(j + 1, n - 1) * c;
        }
        unsigned long long s2 = 0;
        for(auto k : g[i]) {
            if(k != i + 1) {
                total -= (1LL * a * i + 1LL * c * k) * (k - i - 1);
                total -= gaussum(i + 1, k - 1) * b;
            }
        }
    }
    for(int j = 0; j < n; ++j) {
        for(auto k : g[j]) {
            if(!j)
                continue;
            total -= (1LL * b * j + 1LL * c * k) * j;
            total -= gaussum(0, j - 1) * a;
        }
    }
    //adun unde am si pe i, j si pe i, k
    // sau pe i, j si j, k
    // sau pe i, k si j, k

    for(int i = 0; i < n; ++i) {
        unsigned long long sumj = 0, am = 0;
        for(int k : g[i]) {
            if(am) {
                total += sumj * b;
                total += am * (1LL * i * a + 1LL * k * c);
            }
            ++am;
            sumj += k;
        }
    }

    // i, j si j, k

    for(int j = 0; j < n; ++j) {
        int nrp = gin[j].size() * g[j].size();
        unsigned long long sum_gout = 0;
        for(int k : g[j])
            sum_gout += k;
        for(int i : gin[j]) {
            total += (1LL * i + 1ULL * j * b) * g[j].size();
            total += sum_gout * c;
        }
    }

    // i, k si j, k
    // adica fixez pe k

    for(int k = 0; k < n; ++k) {
        long long sum_i = 0, am = 0;
        for(int j : gin[k]) {
            if(am) {
                total += (1ULL * k * c + 1ULL * b * j) * am;
                total += sum_i * a;
            }
            ++am;
            sum_i += j;
        }
    }
sqr = sqrt(m) + 1;
    // calculez triunghiurile

    int am_spec = 0;
    for(int i = 0; i < n; ++i)
        if(g[i].size() >= sqr) {
            id_spec[i] = am_spec, ++am_spec;
        } else
            id_spec[i] = -1;
    for(int i = 0; i < m; ++i) {
        int ea, eb;
        tie(ea, eb) = e[i];

        int id_ea = id_spec[ea], id_eb = id_spec[eb];assert(ea < eb);

        if(g[ea].size() >= sqr) {
            are[id_ea][eb] = 1;
        }

    }
    for(int i = 0; i < n; ++i) {
        if(g[i].size() >= sqr) {
            int id_i = id_spec[i];
            for(int j = 0; j < m; ++j) {
                int ea, eb;
                tie(ea, eb) = e[j];
                if(are[id_i][ea] && are[id_i][eb]) {
                    total -= 1ULL * a * i + 1ULL * b * ea + 1ULL * c * eb;
                }
            }
        }

        else {
            for(int j : g[i]) {
                int ptr_j = 0;
                for(int k : g[i]) {
                    if(j > k) continue;
                    if(g[j].size() < sqr) {
                        while(ptr_j < (int)g[j].size() && g[j][ptr_j] < k)
                            ++ ptr_j;
                        if(ptr_j != (int)g[j].size() && g[j][ptr_j] == k)
                            total -= 1ULL * a * i +  b * j + c * k;
                    }

                    else {
                        int id_j = id_spec[j];
                        if(are[id_j][k])
                            total -= a * i + b * j +  c * k;
                    }
                }
            }
        }
    }

cout << total;
}


#include <bits/stdc++.h>

using namespace std;

/*/
total - (i, j) - (i, k) - (j, k) + (i, j, k) /*/
const int N = 2e5 + 2;

int n, m;
unsigned long long a, b, c, sqr;
unsigned long long total;
vector<int>g[N];

pair<int, int>e[N];

int id_spec[N];
bitset<N>are[700];
unsigned long long comb2(int x) {
    return 1LL * x * (x - 1) / 2;
}

unsigned long long gaussum(int x) {
    return 1LL * x * (x + 1) / 2;
}
vector<int>gin[N];
unsigned long long gaussum(int i, int j) {
    if(i > j)
        return 0 ;
    return gaussum(j) - gaussum(i - 1);
}
int main() {
#ifndef ONLINE_JUDGE
    freopen("data.in", "r", stdin);
#endif // ONLINE_JUDGE

    cin >> n >> m >> a >> b >> c;
    sqr = sqrt(m) + 1;
    for(int i = 0;  i < m; ++i) {
        int na, nb;
        cin >> na >> nb;
        if(na > nb)
            swap(na, nb);
        g[na].push_back(nb);
        gin[nb].push_back(na);
        assert(na < nb);
        e[i] = make_pair(na, nb);
    }

    for(int i = 0; i < n; ++i)
        sort(g[i].begin(), g[i].end());

    for(int i = 0; i < n; ++i) {
        total += i * a * comb2(n - i - 1);
        total += 1LL * (n - i - 1) * i * b * i;
        total += comb2(i) * i * c;
    }

    // acum scad unde exista (i, j) perechea

    for(int i = 0; i < n; ++i) {
        for(auto j : g[i]) {
            if(j == n - 1)
                continue;
            total -= (1LL * a * i + 1LL * b * j) * (n - j - 1);
            total -= gaussum(j + 1, n - 1) * c;
        }
        unsigned long long s2 = 0;
        for(auto k : g[i]) {
            if(k != i + 1) {
                total -= (1LL * a * i + 1LL * c * k) * (k - i - 1);
                total -= gaussum(i + 1, k - 1) * b;
            }
        }
    }
    for(int j = 0; j < n; ++j) {
        for(auto k : g[j]) {
            if(!j)
                continue;
            total -= (1LL * b * j + 1LL * c * k) * j;
            total -= gaussum(0, j - 1) * a;
        }
    }
    //adun unde am si pe i, j si pe i, k
    // sau pe i, j si j, k
    // sau pe i, k si j, k

    for(int i = 0; i < n; ++i) {
        unsigned long long sumj = 0, am = 0;
        for(int k : g[i]) {
            if(am) {
                total += sumj * b;
                total += am * (1LL * i * a + 1LL * k * c);
            }
            ++am;
            sumj += k;
        }
    }

    // i, j si j, k

    for(int j = 0; j < n; ++j) {
        int nrp = gin[j].size() * g[j].size();
        unsigned long long sum_gout = 0;
        for(int k : g[j])
            sum_gout += k;
        for(int i : gin[j]) {
            total += (1LL * i + 1ULL * j * b) * g[j].size();
            total += sum_gout * c;
        }
    }

    // i, k si j, k
    // adica fixez pe k

    for(int k = 0; k < n; ++k) {
        long long sum_i = 0, am = 0;
        for(int j : gin[k]) {
            if(am) {
                total += (1ULL * k * c + 1ULL * b * j) * am;
                total += sum_i * a;
            }
            ++am;
            sum_i += j;
        }
    }
sqr = sqrt(m) + 1;
    // calculez triunghiurile

    int am_spec = 0;
    for(int i = 0; i < n; ++i)
        if(g[i].size() >= sqr) {
            id_spec[i] = am_spec, ++am_spec;
        } else
            id_spec[i] = -1;
    for(int i = 0; i < m; ++i) {
        int ea, eb;
        tie(ea, eb) = e[i];

        int id_ea = id_spec[ea], id_eb = id_spec[eb];assert(ea < eb);

        if(g[ea].size() >= sqr) {
            are[id_ea][eb] = 1;
        }

    }
    for(int i = 0; i < n; ++i) {
        if(g[i].size() >= sqr) {
            int id_i = id_spec[i];
            for(int j = 0; j < m; ++j) {
                int ea, eb;
                tie(ea, eb) = e[j];
                if(are[id_i][ea] && are[id_i][eb]) {
                    total -= 1ULL * a * i + 1ULL * b * ea + 1ULL * c * eb;
                }
            }
        }

        else {
            for(int j : g[i]) {
                int ptr_j = 0;
                for(int k : g[i]) {
                    if(j > k) continue;
                    if(g[j].size() < sqr) {
                        while(ptr_j < (int)g[j].size() && g[j][ptr_j] < k)
                            ++ ptr_j;
                        if(ptr_j != (int)g[j].size() && g[j][ptr_j] == k)
                            total -= 1ULL * a * i +  b * j + c * k;
                    }

                    else {
                        int id_j = id_spec[j];
                        if(are[id_j][k])
                            total -= a * i + b * j +  c * k;
                    }
                }
            }
        }
    }

cout << total;
}


#include <bits/stdc++.h>

using namespace std;

/*/
total - (i, j) - (i, k) - (j, k) + (i, j, k) /*/
const int N = 2e5 + 2;

int n, m;
unsigned long long a, b, c, sqr;
unsigned long long total;
vector<int>g[N];

pair<int, int>e[N];

int id_spec[N];
bitset<N>are[2000];
unsigned long long comb2(unsigned long long x) {
    return 1LL * x * (x - 1) / 2;
}

unsigned long long gaussum(unsigned long long x) {
    return  x * (x + 1) / 2;
}
vector<int>gin[N];
unsigned long long gaussum(int i, int j) {
    if(i > j)
        return 0 ;
    return gaussum(j) - gaussum(i - 1);
}
int main() {
#ifndef ONLINE_JUDGE
    freopen("data.in", "r", stdin);
#endif // ONLINE_JUDGE

    cin >> n >> m >> a >> b >> c;
    sqr = 1000;
    for(int i = 0;  i < m; ++i) {
        int na, nb;
        cin >> na >> nb;
        if(na > nb)
            swap(na, nb);
        g[na].push_back(nb);
        gin[nb].push_back(na);
        assert(na < nb);
        e[i] = make_pair(na, nb);
    }

    for(int i = 0; i < n; ++i)
        sort(g[i].begin(), g[i].end()), sort(gin[i].begin(), gin[i].end());

    for(int i = 0; i < n; ++i) {
        total += i * a * comb2(n - i - 1);
        total += b* (n - i - 1) * i * i;
        total += comb2(i) * i * c;
    }
   for(int i = 0; i < n; ++i) {
        unsigned long long sumj = 0, am = 0;
        for(int k : g[i]) {
            if(am) {
                total += sumj * b;
                total += am * (i * a +  k * c);
            }
            ++am;
            sumj += k;
        }
    }

    // acum scad unde exista (i, j) perechea

    for(int i = 0; i < n; ++i) {
        for(auto j : g[i]) {
            if(j == n - 1)
                continue;
            total -= (a * i + b * j) * (n - j - 1);
            total -= gaussum(j + 1, n - 1) * c;
        }
        unsigned long long s2 = 0;
        for(auto k : g[i]) {
            if(k != i + 1) {
                total -= ( a * i +  c * k) * (k - i - 1);
                total -= gaussum(i + 1, k - 1) * b;
            }
        }
    }
    for(int j = 0; j < n; ++j) {
        for(auto k : g[j]) {
            if(!j)
                continue;
            total -= (b * j  +c * k) * j;
            total -= gaussum(0, j - 1) * a;
        }
    }
    //adun unde am si pe i, j si pe i, k
    // sau pe i, j si j, k
    // sau pe i, k si j, k

    // i, j si j, k

    for(int j = 0; j < n; ++j) {
        int nrp = gin[j].size() * g[j].size();
        unsigned long long sum_gout = 0;
        for(int k : g[j])
            sum_gout += k;
        for(int i : gin[j]) {
            total += (1LL * i + 1ULL * j * b) * g[j].size();
            total += sum_gout * c;
        }
    }

    // i, k si j, k
    // adica fixez pe k

    for(int k = 0; k < n; ++k) {
        long long sum_i = 0, am = 0;
        for(int j : gin[k]) {
            if(am) {
                total += (1ULL * k * c + 1ULL * b * j) * am;
                total += sum_i * a;
            }
            ++am;
            sum_i += j;
        }
    }
sqr = m+1;
    // calculez triunghiurile

    int am_spec = 0;
    for(int i = 0; i < n; ++i)
        if(g[i].size() >= sqr) {
            id_spec[i] = am_spec, ++am_spec;
        } else
            id_spec[i] = -1;
    for(int i = 0; i < m; ++i) {
        int ea, eb;
        tie(ea, eb) = e[i];

        int id_ea = id_spec[ea], id_eb = id_spec[eb];assert(ea < eb);

        if(g[ea].size() >= sqr) {
            are[id_ea][eb] = 1;
        }

    }
    for(int i = 0; i < n; ++i) {
        if(g[i].size() >= sqr) {
            int id_i = id_spec[i];
            for(int j = 0; j < m; ++j) {
                int ea, eb;
                tie(ea, eb) = e[j];
                if(are[id_i][ea] && are[id_i][eb]) {
                    total -= 1ULL * a * i + 1ULL * b * ea + 1ULL * c * eb;
                }
            }
        }

        else {
            for(int j : g[i]) {
                int ptr_j = 0;
                for(int k : g[i]) {
                    if(j > k) continue;
                    if(g[j].size() < sqr) {
                        while(ptr_j < (int)g[j].size() && g[j][ptr_j] < k)
                            ++ ptr_j;
                        if(ptr_j != (int)g[j].size() && g[j][ptr_j] == k)
                            total -= 1ULL * a * i +  b * j + c * k;
                    }

                    else {
                        int id_j = id_spec[j];
                        if(are[id_j][k])
                            total -= a * i + b * j +  c * k;
                    }
                }
            }
        }
    }

cout << total;
}


#include <bits/stdc++.h>

using namespace std;

/*/
total - (i, j) - (i, k) - (j, k) + (i, j, k) /*/
const int N = 2e5 + 2;

int n, m;
unsigned long long a, b, c, sqr;
unsigned long long total;
vector<int>g[N];

pair<int, int>e[N];

int id_spec[N];
bitset<N>are[700];
unsigned long long comb2(int x) {
    return 1LL * x * (x - 1) / 2;
}

unsigned long long gaussum(int x) {
    return 1LL * x * (x + 1) / 2;
}
vector<int>gin[N];
unsigned long long gaussum(int i, int j) {
    if(i > j)
        return 0 ;
    return gaussum(j) - gaussum(i - 1);
}
int main() {
#ifndef ONLINE_JUDGE
    freopen("data.in", "r", stdin);
#endif // ONLINE_JUDGE

    cin >> n >> m >> a >> b >> c;
    sqr = sqrt(m) + 1;
    for(int i = 0;  i < m; ++i) {
        int na, nb;
        cin >> na >> nb;
        if(na > nb)
            swap(na, nb);
        g[na].push_back(nb);
        gin[nb].push_back(na);
        assert(na < nb);
        e[i] = make_pair(na, nb);
    }

    for(int i = 0; i < n; ++i)
        sort(g[i].begin(), g[i].end());

    for(int i = 0; i < n; ++i) {
        total += i * a * comb2(n - i - 1);
        total += 1LL * (n - i - 1) * i * b * i;
        total += comb2(i) * i * c;
    }

    // acum scad unde exista (i, j) perechea

    for(int i = 0; i < n; ++i) {
        for(auto j : g[i]) {
            if(j == n - 1)
                continue;
            total -= (1LL * a * i + 1LL * b * j) * (n - j - 1);
            total -= gaussum(j + 1, n - 1) * c;
        }
        unsigned long long s2 = 0;
        for(auto k : g[i]) {
            if(k != i + 1) {
                total -= (1LL * a * i + 1LL * c * k) * (k - i - 1);
                total -= gaussum(i + 1, k - 1) * b;
            }
        }
    }
    for(int j = 0; j < n; ++j) {
        for(auto k : g[j]) {
            if(!j)
                continue;
            total -= (1LL * b * j + 1LL * c * k) * j;
            total -= gaussum(0, j - 1) * a;
        }
    }
    //adun unde am si pe i, j si pe i, k
    // sau pe i, j si j, k
    // sau pe i, k si j, k

    for(int i = 0; i < n; ++i) {
        unsigned long long sumj = 0, am = 0;
        for(int k : g[i]) {
            if(am) {
                total += sumj * b;
                total += am * (1LL * i * a + 1LL * k * c);
            }
            ++am;
            sumj += k;
        }
    }

    // i, j si j, k

    for(int j = 0; j < n; ++j) {
        int nrp = gin[j].size() * g[j].size();
        unsigned long long sum_gout = 0;
        for(int k : g[j])
            sum_gout += k;
        for(int i : gin[j]) {
            total += (1LL * i + 1ULL * j * b) * g[j].size();
            total += sum_gout * c;
        }
    }

    // i, k si j, k
    // adica fixez pe k

    for(int k = 0; k < n; ++k) {
        long long sum_i = 0, am = 0;
        for(int j : gin[k]) {
            if(am) {
                total += (1ULL * k * c + 1ULL * b * j) * am;
                total += sum_i * a;
            }
            ++am;
            sum_i += j;
        }
    }
sqr = sqrt(m) + 1;
    // calculez triunghiurile

    int am_spec = 0;
    for(int i = 0; i < n; ++i)
        if(g[i].size() >= sqr) {
            id_spec[i] = am_spec, ++am_spec;
        } else
            id_spec[i] = -1;
    for(int i = 0; i < m; ++i) {
        int ea, eb;
        tie(ea, eb) = e[i];

        int id_ea = id_spec[ea], id_eb = id_spec[eb];assert(ea < eb);

        if(g[ea].size() >= sqr) {
            are[id_ea][eb] = 1;
        }

    }
    for(int i = 0; i < n; ++i) {
        if(g[i].size() >= sqr) {
            int id_i = id_spec[i];
            for(int j = 0; j < m; ++j) {
                int ea, eb;
                tie(ea, eb) = e[j];
                if(are[id_i][ea] && are[id_i][eb]) {
                    total -= 1ULL * a * i + 1ULL * b * ea + 1ULL * c * eb;
                }
            }
        }

        else {
            for(int j : g[i]) {
                int ptr_j = 0;
                for(int k : g[i]) {
                    if(j > k) continue;
                    if(g[j].size() < sqr) {
                        while(ptr_j < (int)g[j].size() && g[j][ptr_j] < k)
                            ++ ptr_j;
                        if(ptr_j != (int)g[j].size() && g[j][ptr_j] == k)
                            total -= 1ULL * a * i +  b * j + c * k;
                    }

                    else {
                        int id_j = id_spec[j];
                        if(are[id_j][k])
                            total -= 1ULL * a * i + b * j + * c * k;
                    }
                }
            }
        }
    }

cout << total;
}


#include <bits/stdc++.h>

using namespace std;

/*/
total - (i, j) - (i, k) - (j, k) + (i, j, k) /*/
const int N = 2e5 + 2;

int n, m;
unsigned long long a, b, c, sqr;
unsigned long long total;
vector<int>g[N];

pair<int, int>e[N];

int id_spec[N];
bitset<N>are[2000];
unsigned long long comb2(unsigned long long x) {
    return 1LL * x * (x - 1) / 2;
}

unsigned long long gaussum(unsigned long long x) {
    return  x * (x + 1) / 2;
}
vector<int>gin[N];
unsigned long long gaussum(int i, int j) {
    if(i > j)
        return 0 ;
    return gaussum(j) - gaussum(i - 1);
}
int main() {
#ifndef ONLINE_JUDGE
    freopen("data.in", "r", stdin);
#endif // ONLINE_JUDGE

    cin >> n >> m >> a >> b >> c;
    sqr = 1000;
    for(int i = 0;  i < m; ++i) {
        int na, nb;
        cin >> na >> nb;
        if(na > nb)
            swap(na, nb);
        g[na].push_back(nb);
        gin[nb].push_back(na);
        assert(na < nb);
        e[i] = make_pair(na, nb);
    }

    for(int i = 0; i < n; ++i)
        sort(g[i].begin(), g[i].end());

    for(int i = 0; i < n; ++i) {
        total += i * a * comb2(n - i - 1);
        total += 1LL * (n - i - 1) * i * b * i;
        total += comb2(i) * i * c;
    }

    // acum scad unde exista (i, j) perechea

    for(int i = 0; i < n; ++i) {
        for(auto j : g[i]) {
            if(j == n - 1)
                continue;
            total -= (1LL * a * i + 1LL * b * j) * (n - j - 1);
            total -= gaussum(j + 1, n - 1) * c;
        }
        unsigned long long s2 = 0;
        for(auto k : g[i]) {
            if(k != i + 1) {
                total -= (1LL * a * i + 1LL * c * k) * (k - i - 1);
                total -= gaussum(i + 1, k - 1) * b;
            }
        }
    }
    for(int j = 0; j < n; ++j) {
        for(auto k : g[j]) {
            if(!j)
                continue;
            total -= (1LL * b * j + 1LL * c * k) * j;
            total -= gaussum(0, j - 1) * a;
        }
    }
    //adun unde am si pe i, j si pe i, k
    // sau pe i, j si j, k
    // sau pe i, k si j, k

    for(int i = 0; i < n; ++i) {
        unsigned long long sumj = 0, am = 0;
        for(int k : g[i]) {
            if(am) {
                total += sumj * b;
                total += am * (1LL * i * a + 1LL * k * c);
            }
            ++am;
            sumj += k;
        }
    }

    // i, j si j, k

    for(int j = 0; j < n; ++j) {
        int nrp = gin[j].size() * g[j].size();
        unsigned long long sum_gout = 0;
        for(int k : g[j])
            sum_gout += k;
        for(int i : gin[j]) {
            total += (1LL * i + 1ULL * j * b) * g[j].size();
            total += sum_gout * c;
        }
    }

    // i, k si j, k
    // adica fixez pe k

    for(int k = 0; k < n; ++k) {
        long long sum_i = 0, am = 0;
        for(int j : gin[k]) {
            if(am) {
                total += (1ULL * k * c + 1ULL * b * j) * am;
                total += sum_i * a;
            }
            ++am;
            sum_i += j;
        }
    }
sqr = sqrt(m) + 1;
    // calculez triunghiurile

    int am_spec = 0;
    for(int i = 0; i < n; ++i)
        if(g[i].size() >= sqr) {
            id_spec[i] = am_spec, ++am_spec;
        } else
            id_spec[i] = -1;
    for(int i = 0; i < m; ++i) {
        int ea, eb;
        tie(ea, eb) = e[i];

        int id_ea = id_spec[ea], id_eb = id_spec[eb];assert(ea < eb);

        if(g[ea].size() >= sqr) {
            are[id_ea][eb] = 1;
        }

    }
    for(int i = 0; i < n; ++i) {
        if(g[i].size() >= sqr) {
            int id_i = id_spec[i];
            for(int j = 0; j < m; ++j) {
                int ea, eb;
                tie(ea, eb) = e[j];
                if(are[id_i][ea] && are[id_i][eb]) {
                    total -= 1ULL * a * i + 1ULL * b * ea + 1ULL * c * eb;
                }
            }
        }

        else {
            for(int j : g[i]) {
                int ptr_j = 0;
                for(int k : g[i]) {
                    if(j > k) continue;
                    if(g[j].size() < sqr) {
                        while(ptr_j < (int)g[j].size() && g[j][ptr_j] < k)
                            ++ ptr_j;
                        if(ptr_j != (int)g[j].size() && g[j][ptr_j] == k)
                            total -= 1ULL * a * i +  b * j + c * k;
                    }

                    else {
                        int id_j = id_spec[j];
                        if(are[id_j][k])
                            total -= a * i + b * j +  c * k;
                    }
                }
            }
        }
    }

cout << total;
}


#include <bits/stdc++.h>

using namespace std;

/*/
total - (i, j) - (i, k) - (j, k) + (i, j, k) /*/
const int N = 2e5 + 2;

int n, m;
unsigned long long a, b, c, sqr;
unsigned long long total;
vector<int>g[N];

pair<int, int>e[N];

int id_spec[N];
bitset<N>are[2000];
unsigned long long comb2(unsigned long long x) {
    return 1LL * x * (x - 1) / 2;
}

unsigned long long gaussum(unsigned long long x) {
    return  x * (x + 1) / 2;
}
vector<int>gin[N];
unsigned long long gaussum(int i, int j) {
    if(i > j)
        return 0 ;
    return gaussum(j) - gaussum(i - 1);
}
int main() {
#ifndef ONLINE_JUDGE
    freopen("data.in", "r", stdin);
#endif // ONLINE_JUDGE

    cin >> n >> m >> a >> b >> c;
    sqr = 800;
    for(int i = 0;  i < m; ++i) {
        int na, nb;
        cin >> na >> nb;
        if(na > nb)
            swap(na, nb);
        g[na].push_back(nb);
        gin[nb].push_back(na);
        assert(na < nb);
        e[i] = make_pair(na, nb);
    }

    for(int i = 0; i < n; ++i)
        sort(g[i].begin(), g[i].end());

    for(int i = 0; i < n; ++i) {
        total += i * a * comb2(n - i - 1);
        total += 1LL * (n - i - 1) * i * b * i;
        total += comb2(i) * i * c;
    }

    // acum scad unde exista (i, j) perechea

    for(int i = 0; i < n; ++i) {
        for(auto j : g[i]) {
            if(j == n - 1)
                continue;
            total -= (1LL * a * i + 1LL * b * j) * (n - j - 1);
            total -= gaussum(j + 1, n - 1) * c;
        }
        unsigned long long s2 = 0;
        for(auto k : g[i]) {
            if(k != i + 1) {
                total -= (1LL * a * i + 1LL * c * k) * (k - i - 1);
                total -= gaussum(i + 1, k - 1) * b;
            }
        }
    }
    for(int j = 0; j < n; ++j) {
        for(auto k : g[j]) {
            if(!j)
                continue;
            total -= (1LL * b * j + 1LL * c * k) * j;
            total -= gaussum(0, j - 1) * a;
        }
    }
    //adun unde am si pe i, j si pe i, k
    // sau pe i, j si j, k
    // sau pe i, k si j, k

    for(int i = 0; i < n; ++i) {
        unsigned long long sumj = 0, am = 0;
        for(int k : g[i]) {
            if(am) {
                total += sumj * b;
                total += am * (1LL * i * a + 1LL * k * c);
            }
            ++am;
            sumj += k;
        }
    }

    // i, j si j, k

    for(int j = 0; j < n; ++j) {
        int nrp = gin[j].size() * g[j].size();
        unsigned long long sum_gout = 0;
        for(int k : g[j])
            sum_gout += k;
        for(int i : gin[j]) {
            total += (1LL * i + 1ULL * j * b) * g[j].size();
            total += sum_gout * c;
        }
    }

    // i, k si j, k
    // adica fixez pe k

    for(int k = 0; k < n; ++k) {
        long long sum_i = 0, am = 0;
        for(int j : gin[k]) {
            if(am) {
                total += (1ULL * k * c + 1ULL * b * j) * am;
                total += sum_i * a;
            }
            ++am;
            sum_i += j;
        }
    }
sqr = sqrt(m) + 1;
    // calculez triunghiurile

    int am_spec = 0;
    for(int i = 0; i < n; ++i)
        if(g[i].size() >= sqr) {
            id_spec[i] = am_spec, ++am_spec;
        } else
            id_spec[i] = -1;
    for(int i = 0; i < m; ++i) {
        int ea, eb;
        tie(ea, eb) = e[i];

        int id_ea = id_spec[ea], id_eb = id_spec[eb];assert(ea < eb);

        if(g[ea].size() >= sqr) {
            are[id_ea][eb] = 1;
        }

    }
    for(int i = 0; i < n; ++i) {
        if(g[i].size() >= sqr) {
            int id_i = id_spec[i];
            for(int j = 0; j < m; ++j) {
                int ea, eb;
                tie(ea, eb) = e[j];
                if(are[id_i][ea] && are[id_i][eb]) {
                    total -= 1ULL * a * i + 1ULL * b * ea + 1ULL * c * eb;
                }
            }
        }

        else {
            for(int j : g[i]) {
                int ptr_j = 0;
                for(int k : g[i]) {
                    if(j > k) continue;
                    if(g[j].size() < sqr) {
                        while(ptr_j < (int)g[j].size() && g[j][ptr_j] < k)
                            ++ ptr_j;
                        if(ptr_j != (int)g[j].size() && g[j][ptr_j] == k)
                            total -= 1ULL * a * i +  b * j + c * k;
                    }

                    else {
                        int id_j = id_spec[j];
                        if(are[id_j][k])
                            total -= a * i + b * j +  c * k;
                    }
                }
            }
        }
    }

cout << total;
}