#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 = 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) {
        unsigned long long sum_gout = 0;
        for(int k : g[j])
            sum_gout += k;
        for(int i : gin[j]) {
            total += (1LL * i * a + 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;
    }

    // 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 = 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;
long long a, b, c, sqr;
long long total;
vector<int>g[N];

pair<int, int>e[N];

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

long long gaussum(int x) {
    return 1LL * x * (x + 1) / 2;
}
vector<int>gin[N];
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;

template <typename T> void chmin(T&x,const T &y)
{
	if(x>y)x=y;
}
template <typename T> void chmax(T &x,const T &y)
{
	if(x<y)x=y;
}
typedef long long s64;
typedef unsigned long long u64;
typedef unsigned int u32;
typedef pair<int,int> pii;
#define rep(i,l,r) for(int i=l;i<=r;++i)
#define per(i,r,l) for(int i=r;i>=l;--i)
#define rep0(i,l,r) for(int i=l;i<r;++i)
#define pb push_back
#define gc (c=getchar())
int read()
{
	char c;
	while(gc<'-');
	if(c=='-')
	{
		int x=gc-'0';
		while(gc>='0')x=x*10+c-'0';
		return -x;
	}
	int x=c-'0';
	while(gc>='0')x=x*10+c-'0';
	return x;
}
#undef gc

const int N=2e5+5;
int n,m;
pii edge[N];
u64 ans[N];
int in_3c[N][3];//cnt that appear in 3-circle
namespace GET_IN_3C
{
int du[N];
vector<int>lk[N];
bool in[N];
bool da(int x,int y)
{
	return du[x]!=du[y]?du[x]>du[y]:x>y;
}
void main()
{
	rep(i,1,m){++du[edge[i].first];++du[edge[i].second];}
	rep(i,1,m)
	{
		int x=edge[i].first,y=edge[i].second;
		if(!da(x,y))swap(x,y);
		lk[x].push_back(y);
	}
	rep(x,1,n)
	{
		for(auto y:lk[x])in[y]=1;
		for(auto y:lk[x])
		{
			for(auto z:lk[y])
			{
				int a=x,b=y,c=z;
				if(b<a)swap(a,b);
				if(c<b)swap(c,b);
				if(b<a)swap(a,b);
				++in_3c[a][0];
				++in_3c[b][1];
				++in_3c[c][2];
			}
		}
		for(auto y:lk[x])in[y]=0;
	}
}
};
vector<int>lkl[N],lkr[N];
void init_lk()
{
	rep(x,1,n){lkl[x].clear();lkr[x].clear();}
	rep(i,1,m)
	{
		int l=edge[i].first,r=edge[i].second;
		if(l>r)swap(l,r);
		lkr[l].push_back(r);
		lkl[r].push_back(l);
	}
}
namespace SOLVE1
{
int s[N];
void main()
{
	init_lk();
	rep(x,1,n)ans[x]=u64(x-1-lkl[x].size())*(n-x-lkr[x].size());
	rep(i,1,m)
	{
		int l=edge[i].first,r=edge[i].second;
		if(l>r)swap(l,r);
		++s[l+1];--s[r];
	}
	rep(i,1,n)s[i]+=s[i-1];
	rep(x,1,n)ans[x]-=s[x];
	rep(x,1,n)
	{
		sort(lkl[x].begin(),lkl[x].end());
		rep0(i,0,lkl[x].size())ans[lkl[x][i]]+=i;
		sort(lkr[x].begin(),lkr[x].end(),greater<int>());
		rep0(i,0,lkr[x].size())ans[lkr[x][i]]+=i;
	}
}
};
namespace SOLVE0
{
int s[N];
void main()
{
	init_lk();
	rep(x,1,n)
	{
		int c=n-x-lkr[x].size();
		ans[x]=u64(c)*(c-1)/2;
	}
	per(x,n,1)s[x]=s[x+1]+lkr[x].size();
	rep(x,1,n)ans[x]-=s[x+1];
	rep(x,1,n)
	{
		sort(lkl[x].begin(),lkl[x].end(),greater<int>());
		rep0(i,0,lkl[x].size())ans[lkl[x][i]]+=i+lkr[x].size();
	}
}
};

int main()
{
#ifdef kcz
	freopen("1.in","r",stdin);//freopen("1.out","w",stdout);
#endif
	int a,b,c;
	cin>>n>>m>>a>>b>>c;
	rep(i,1,m)edge[i]=pii(read()+1,read()+1);

	GET_IN_3C::main();

	SOLVE1::main();
	u64 ans=0,sum=0;
	rep(x,1,n)sum+=(x-1)*(::ans[x]-in_3c[x][1]);
	ans+=b*sum;

	SOLVE0::main();
	sum=0;
	rep(x,1,n)sum+=(x-1)*(::ans[x]-in_3c[x][0]);
	ans+=a*sum;

	rep(i,1,m)edge[i]=pii(n-edge[i].first+1,n-edge[i].second+1);
	SOLVE0::main();
	sum=0;
	rep(x,1,n)sum+=(x-1)*(::ans[n-x+1]-in_3c[x][2]);
	ans+=c*sum;

	cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;

template <typename T> void chmin(T&x,const T &y)
{
	if(x>y)x=y;
}
template <typename T> void chmax(T &x,const T &y)
{
	if(x<y)x=y;
}
typedef long long s64;
typedef unsigned long long u64;
typedef unsigned int u32;
typedef pair<int,int> pii;
#define rep(i,l,r) for(int i=l;i<=r;++i)
#define per(i,r,l) for(int i=r;i>=l;--i)
#define rep0(i,l,r) for(int i=l;i<r;++i)
#define pb push_back
#define gc (c=getchar())
int read()
{
	char c;
	while(gc<'-');
	if(c=='-')
	{
		int x=gc-'0';
		while(gc>='0')x=x*10+c-'0';
		return -x;
	}
	int x=c-'0';
	while(gc>='0')x=x*10+c-'0';
	return x;
}
#undef gc

const int N=2e5+5;
int n,m;
pii edge[N];
u64 ans[N];
int in_3c[N][3];//cnt that appear in 3-circle
namespace GET_IN_3C
{
int du[N];
vector<int>lk[N];
bool in[N];
bool da(int x,int y)
{
	return du[x]!=du[y]?du[x]>du[y]:x>y;
}
void main()
{
	rep(i,1,m){++du[edge[i].first];++du[edge[i].second];}
	rep(i,1,m)
	{
		int x=edge[i].first,y=edge[i].second;
		if(!da(x,y))swap(x,y);
		lk[x].push_back(y);
	}
	rep(x,1,n)
	{
		for(auto y:lk[x])in[y]=1;
		for(auto y:lk[x])
		{
			for(auto z:lk[y])
			if(in[z])
			{
				int a=x,b=y,c=z;
				if(b<a)swap(a,b);
				if(c<b)swap(c,b);
				if(b<a)swap(a,b);
				++in_3c[a][0];
				++in_3c[b][1];
				++in_3c[c][2];
			}
		}
		for(auto y:lk[x])in[y]=0;
	}
}
};
vector<int>lkl[N],lkr[N];
void init_lk()
{
	rep(x,1,n){lkl[x].clear();lkr[x].clear();}
	rep(i,1,m)
	{
		int l=edge[i].first,r=edge[i].second;
		if(l>r)swap(l,r);
		lkr[l].push_back(r);
		lkl[r].push_back(l);
	}
}
namespace SOLVE1
{
int s[N];
void main()
{
	init_lk();
	rep(x,1,n)ans[x]=u64(x-1-lkl[x].size())*(n-x-lkr[x].size());
	rep(i,1,m)
	{
		int l=edge[i].first,r=edge[i].second;
		if(l>r)swap(l,r);
		++s[l+1];--s[r];
	}
	rep(i,1,n)s[i]+=s[i-1];
	rep(x,1,n)ans[x]-=s[x];
	rep(x,1,n)
	{
		sort(lkl[x].begin(),lkl[x].end());
		rep0(i,0,lkl[x].size())ans[lkl[x][i]]+=i;
		sort(lkr[x].begin(),lkr[x].end(),greater<int>());
		rep0(i,0,lkr[x].size())ans[lkr[x][i]]+=i;
	}
}
};
namespace SOLVE0
{
int s[N];
void main()
{
	init_lk();
	rep(x,1,n)
	{
		int c=n-x-lkr[x].size();
		ans[x]=u64(c)*(c-1)/2;
	}
	per(x,n,1)s[x]=s[x+1]+lkr[x].size();
	rep(x,1,n)ans[x]-=s[x+1];
	rep(x,1,n)
	{
		sort(lkl[x].begin(),lkl[x].end(),greater<int>());
		rep0(i,0,lkl[x].size())ans[lkl[x][i]]+=i+lkr[x].size();
	}
}
};

int main()
{
#ifdef kcz
	freopen("1.in","r",stdin);//freopen("1.out","w",stdout);
#endif
	int a,b,c;
	cin>>n>>m>>a>>b>>c;
	rep(i,1,m)edge[i]=pii(read()+1,read()+1);

	GET_IN_3C::main();

	SOLVE1::main();
	u64 ans=0,sum=0;
	rep(x,1,n)sum+=(x-1)*(::ans[x]-in_3c[x][1]);
	ans+=b*sum;

	SOLVE0::main();
	sum=0;
	rep(x,1,n)sum+=(x-1)*(::ans[x]-in_3c[x][0]);
	ans+=a*sum;

	rep(i,1,m)edge[i]=pii(n-edge[i].first+1,n-edge[i].second+1);
	SOLVE0::main();
	sum=0;
	rep(x,1,n)sum+=(x-1)*(::ans[n-x+1]-in_3c[x][2]);
	ans+=c*sum;

	cout<<ans;
}


#include<bits/stdc++.h>
#define u64 unsigned long long
using namespace std;
const u64 Maxn=200010;
void read(u64 &x){
	char ch=getchar();x=0;
	for(;ch<'0'||ch>'9';ch=getchar());
	for(;ch>='0'&&ch<='9';ch=getchar())x=x*10+ch-'0';
}

struct hashnode{
	u64 t,next;
}hash[Maxn];u64 first[1<<16],tot;
const u64 mx=(1<<16)-1;
void add(u64 p){
	u64 k=p&mx;
	hash[++tot].t=p;
	hash[tot].next=first[k];
	first[k]=tot;
}

bool check(u64 p){
	u64 k=p&mx;
	for(u64 u=first[k];u;u=hash[u].next){
		if(hash[u].t==p)return true;
	}
	return false;
}
vector<u64>vec[Maxn];
u64 s1[Maxn],s2[Maxn],n1[Maxn],n2[Maxn];
struct lnode{
	u64 x,y;
}list[Maxn];
u64 n,m,A,B,C;
int main(){
	u64 i,j,k;
	read(n);
	read(m);
	read(A);
	read(B);
	read(C);
	u64 ans=0;
	for(i=0;i<n;++i){
		ans+=(n-i-1)*(n-i-2)/2*A*i;
		ans+=(n-i-1)*i*B*i;
		ans+=i*(i-1)/2*C*i;
	}
	for(i=1;i<=m;++i){
		u64 x,y;
		read(x);
		read(y);
		vec[x].push_back(y);
		vec[y].push_back(x);
		if(x>y)swap(x,y);
		add(x*(n+1)+y);
		s1[y]+=x;
		++n1[y];
		s2[x]+=y;
		++n2[x];
		ans-=x*(x-1)/2*A+x*(x*B+y*C);
		ans-=(x+y)*(y-x-1)/2*B+(y-x-1)*(x*A+y*C);
		ans-=(y+n)*(n-y-1)/2*C+(n-y-1)*(x*A+y*B);
		list[i].x=x;
		list[i].y=y;
	}
	for(i=0;i<n;++i){
		sort(vec[i].begin(),vec[i].end());
		u64 p1=0,p2=0,o1=0,o2=0;
		for(j=0;j<vec[i].size();++j){
			u64 x=vec[i][j];
			if(x<i){
				++p1;
				o1+=x;
				ans+=(s1[i]-o1)*B+(n1[i]-p1)*(x*A+i*C);
				ans+=n2[i]*(x*A+i*B)+s2[i]*C;
			}else{
				++p2;
				o2+=x;
				ans+=(s2[i]-o2)*C+(n2[i]-p2)*(i*A+x*B);
			}
		}
	}
	for(i=1;i<=m;++i){
		u64 x=list[i].x,y=list[i].y;
		u64 xx=x,yy=y;
		if(vec[x].size()>vec[y].size())swap(x,y);
		if(xx>yy)swap(xx,yy);
		for(j=0;j<vec[x].size();++j){
			u64 p=vec[x][j];
			if(p<=yy)continue;
			if(check(y*(n+1)+p))ans-= xx*A+yy*B+p*C;
		}
	}
	printf("%I64u\n",ans);
	return 0;
}


#include<bits/stdc++.h>
#define clr(x) memset(x,0,sizeof(x))
#define clr_1(x) memset(x,-1,sizeof(x))
#define mod 1000000007
#define INF 0x3f3f3f3f
#define LL long long
#define pb push_back
#define pbk pop_back
#define ls(i) (i<<1)
#define rs(i) (i<<1|1)
#define mp make_pair
#define ull unsigned long long
#define fi first
#define se second
using namespace std;
const int N=2e5+10;
ull a,b,c,ans;
vector<int> e[N];
vector<pair<int,int> > pe;
vector<int> g[N];
int n,m,k,t,u,v,r,d,sz[N];
ull calc(int p0,int p1,int p2){
	int st[3]={p0,p1,p2};
	sort(st,st+3);
	return a*st[0]+b*st[1]+c*st[2];
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>n>>m>>a>>b>>c;
	ans=0;
	for(int i=0;i<n;++i){
		ans+=a*i*((ull)(n-1-i)*(n-2-i)/2);
		ans+=b*i*i*(n-1-i);
		ans+=c*i*((ull)i*(i-1)/2);
	}
	pe.pb(mp(0,0));
	for(int i=1;i<=m;++i){
		cin>>u>>v;
		e[u].pb(v);
		e[v].pb(u);
		pe.pb(mp(u,v));
		if(u>v)swap(u,v);
		ans-=(a*u+b*v)*(n-1-v)+c*((ull)(v+n)*(n-1-v)/2);
		ans-=(a*u+c*v)*(v-u-1)+b*((ull)(u+v)*(v-u-1)/2);
		ans-=(b*u+c*v)*u+a*((ull)(u-1)*u/2);
	}
	for(int i=0;i<n;++i){
		r=0;
		sz[i]=e[i].size();
		sort(e[i].begin(),e[i].end());
		for(int j=0;j<sz[i];++j){
			d=e[i][j];
			if(d<i)ans+=a*d*(sz[i]-1-j)+b*d*j,++r;
			else ans+=b*d*(sz[i]-1-j)+c*d*j;
		}
		ans+=a*i*((ull)(sz[i]-r)*(sz[i]-r-1)/2);
		ans+=b*i*r*(sz[i]-r)+c*i*((ull)r*(r-1)/2);
	}
	for(int i=1;i<=m;++i){
		u=pe[i].fi;
		v=pe[i].se;
		if(sz[u]>sz[v]||(sz[u]==sz[v]&&u>v))swap(u,v);
		g[u].pb(v);
	}
	for(int i=0;i<n;++i)sort(g[i].begin(),g[i].end());
	for(int i=1;i<=m;++i){
		u=pe[i].fi;
		v=pe[i].se;
		auto p0=g[u].begin();
		auto p1=g[v].begin();
		while(p0!=g[u].end()&&p1!=g[v].end())
		if(*p0==*p1)ans-=calc(u,v,*p0),++p0,++p1;
		else if(*p0<*p1) ++p0;
		else ++p1;
	}
	cout<<ans<<"\n";
	return 0;
}


#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,unsafe-math-optimizations")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,abm,mmx,avx,tune=native")
#include "bits/stdc++.h"
#include <assert.h>
#include <immintrin.h>
#include <emmintrin.h>
using namespace std;
typedef unsigned long long ll;
typedef long double ld;
typedef unsigned int uint;
#define PB push_back
#define MP make_pair
const int MOD=1000000007;
#define endl "\n"
#define fst first
#define snd second
const int UNDEF = -1;
const int INF=1<<30;
template<typename T> inline bool chkmax(T &aa, T bb) { return aa < bb ? aa = bb, true : false; }
template<typename T> inline bool chkmin(T &aa, T bb) { return aa > bb ? aa = bb, true : false; }
typedef pair<ll,ll> pll;typedef vector<ll> vll;typedef pair<int,int> pii;typedef vector<int> vi;typedef vector<vi> vvi;
#ifdef ONLINE_JUDGE
#define assert(...) /* nothing */
#endif
#define DEBUG_CAT
#ifdef DEBUG_CAT
#define dbg(...)   printf( __VA_ARGS__ )
#else
#define dbg(...)   /****nothing****/
#endif
int rint();char rch();long long rlong();
const int mn=200000+1;
vi g[mn];
int bins(vector<int> &v, int key) {
  int imin=0,imax=v.size();
  while(imin<imax) {
    int imid=(imin+imax)>>1;
    if (v[imid]<key) imin=imid+1;
    else imax=imid;
  }
  return imin;

}

bool binf(vector<int> &v, int key) {
  int imin=bins(v,key);
  return (imin<v.size()) && (v[imin]==key);
}

ll C2(ll x) {
  ll a=x,b=x-1;
  if (a&1) b/=2;
  else a/=2;
  return a*b;
}
#define tm tmm
const int L=0,M=1,R=2;
uint tri[mn][3];
uint C[3];
uint vlo[mn],vhi[mn];
uint tl[mn],tm[mn],tr[mn];
ll ans[3];
const int ms=447;
int x2s[mn];
bitset<mn> b[ms];
pii vs[mn];
int main()
{
  ios_base::sync_with_stdio(false); cin.tie(0);
  int n=rint(),m=rint();
  for (int i=0;i<3;i++) C[i]=rint();
  for (int i=0;i<m;i++) {
    int x=rint(),y=rint();
    g[x].PB(y);
    g[y].PB(x);
    vlo[max(x,y)]++;
    vhi[min(x,y)]++;
  }
  for (int x=0;x<n;x++) vs[x]=MP(g[x].size(),x);
  sort(vs,vs+n,greater<pii>());
	int slim=min(n,ms);
	memset(x2s,-1,sizeof x2s);
	for (int s=0;s<slim;s++) {
		int x=vs[s].snd; x2s[x]=s;
		for (auto &y:g[x]) b[s][y]=true;
	}
  for (int x=0;x<n;x++) sort(g[x].begin(),g[x].end());
  for (int x=0;x<n;x++) {
    for (auto &y:g[x]) {
    	uint lt=bins(g[y],x);
    	uint gt=g[y].size()-lt-1;
      if (y<x) {
        tl[x]+=lt;
        tm[x]+=gt;
      }
      else {
        tr[x]+=gt;
        tm[x]+=lt;
      }
    }
  }
	for (int xx=0;xx<n;xx++) {
    for (auto &yy:g[xx]) {
      if (xx>yy) continue;
      int x=xx,y=yy;
      if (g[x].size()>g[y].size()) swap(x,y);
      //assert(g[x].size()<=g[y].size());
      int s=x2s[y];
      if (s==-1) {
      	for (auto &z:g[x]) {
      	  if (binf(g[y],z)) {
      	    int state;
      	    if (z>x&&z>y) state=R;
      	    else if (z<x&&z<y) state=L;
      	    else state=M;
      	    ++tri[z][state];
      	  }
      	}
      }
      else {
      	for (auto &z:g[x]) {
      	  if (b[s][z]) {
      	    int state;
      	    if (z>x&&z>y) state=R;
      	    else if (z<x&&z<y) state=L;
      	    else state=M;
      	    ++tri[z][state];
      	  }
      	}
      }
    }
  }
  int el=0,er=m;
  for (int x=0;x<n;x++) {
    er-=vhi[x];
    ll em=m-el-er-g[x].size();
    // Code goes here
    ll al=x,ar=n-x-1;
    ll bl=vlo[x],br=vhi[x];
    ll gl=al-bl,gr=ar-br;
    { // x is leftmost
      ll one=br*gr+C2(br)+er;
      ll two=tr[x];
      ll three=tri[x][L];
      ll contrib=one-two+three;
      ll all=C2(ar);
      ans[L]+=(all-contrib)*x;
    }
    { // x is on rightmost
      ll one=bl*gl+C2(bl)+el;
      ll two=tl[x];
      ll three=tri[x][R];
      ll contrib=one-two+three;
      ll all=C2(al);
      ans[R]+=(all-contrib)*x;
    }
    { // mid x
      ll one=bl*gr+gl*br+bl*br+em;
      ll two=tm[x];
      ll three=tri[x][M];
      ll contrib=one-two+three;
      ll all=al*ar;
      ans[M]+=(all-contrib)*x;
    }
    // Ends here
    el+=vlo[x];
  }
  ll final=0;
  for (int i=0;i<3;i++) final+=ans[i]*C[i];
  printf("%llu\n",final);
}

static char stdinBuffer[1024];
static char* stdinDataEnd = stdinBuffer + sizeof (stdinBuffer);
static const char* stdinPos = stdinDataEnd;

void readAhead(size_t amount)
{
    size_t remaining = stdinDataEnd - stdinPos;
    if (remaining < amount) {
       memmove(stdinBuffer, stdinPos, remaining);
       size_t sz = fread(stdinBuffer + remaining, 1, sizeof (stdinBuffer) - remaining, stdin);
       stdinPos = stdinBuffer;
       stdinDataEnd = stdinBuffer + remaining + sz;
       if (stdinDataEnd != stdinBuffer + sizeof (stdinBuffer))
         *stdinDataEnd = 0;
    }
}

int rint()
{
    readAhead(16);

    int x = 0;
    bool neg = false;
    while(*stdinPos==' '||*stdinPos=='\n') ++stdinPos;
    if (*stdinPos == '-') {
       ++stdinPos;
       neg = true;
    }

    while (*stdinPos >= '0' && *stdinPos <= '9') {
       x *= 10;
       x += *stdinPos - '0';
       ++stdinPos;
    }

    return neg ? -x : x;
}
char rch()
{
    readAhead(16);
    while(*stdinPos==' '||*stdinPos=='\n') ++stdinPos;
    char ans=*stdinPos;
    ++stdinPos;
    return ans;
}
long long rlong()
{
    readAhead(32);

    long long x = 0;
    bool neg = false;
    while(*stdinPos==' '||*stdinPos=='\n') ++stdinPos;
    if (*stdinPos == '-') {
       ++stdinPos;
       neg = true;
    }

    while (*stdinPos >= '0' && *stdinPos <= '9') {
       x *= 10;
       x += *stdinPos - '0';
       ++stdinPos;
    }

    return neg ? -x : x;
}


#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,unsafe-math-optimizations")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,abm,mmx,avx,tune=native")
#include "bits/stdc++.h"
#include <assert.h>
#include <immintrin.h>
#include <emmintrin.h>
using namespace std;
typedef unsigned long long ll;
typedef long double ld;
typedef unsigned int uint;
#define PB push_back
#define MP make_pair
const int MOD=1000000007;
#define endl "\n"
#define fst first
#define snd second
const int UNDEF = -1;
const int INF=1<<30;
template<typename T> inline bool chkmax(T &aa, T bb) { return aa < bb ? aa = bb, true : false; }
template<typename T> inline bool chkmin(T &aa, T bb) { return aa > bb ? aa = bb, true : false; }
typedef pair<ll,ll> pll;typedef vector<ll> vll;typedef pair<int,int> pii;typedef vector<int> vi;typedef vector<vi> vvi;
#ifdef ONLINE_JUDGE
#define assert(...) /* nothing */
#endif
#define DEBUG_CAT
#ifdef DEBUG_CAT
#define dbg(...)   printf( __VA_ARGS__ )
#else
#define dbg(...)   /****nothing****/
#endif
int rint();char rch();long long rlong();
const int mn=200000+1;
vi g[mn];
int bins(vector<int> &v, int key) {
  int imin=0,imax=v.size();
  while(imin<imax) {
    int imid=(imin+imax)>>1;
    if (v[imid]<key) imin=imid+1;
    else imax=imid;
  }
  return imin;

}

bool binf(vector<int> &v, int key) {
  int imin=bins(v,key);
  return (imin<v.size()) && (v[imin]==key);
}

ll C2(ll x) {
  ll a=x,b=x-1;
  if (a&1) b/=2;
  else a/=2;
  return a*b;
}
#define tm tmm
const int L=0,M=1,R=2;
uint tri[mn][3];
uint C[3];
uint vlo[mn],vhi[mn];
uint tl[mn],tm[mn],tr[mn];
ll ans[3];
const int ms=4000;
int x2s[mn];
bitset<mn> b[ms];
pii vs[mn];
int main()
{
  ios_base::sync_with_stdio(false); cin.tie(0);
  int n=rint(),m=rint();
  for (int i=0;i<3;i++) C[i]=rint();
  for (int i=0;i<m;i++) {
    int x=rint(),y=rint();
    g[x].PB(y);
    g[y].PB(x);
    vlo[max(x,y)]++;
    vhi[min(x,y)]++;
  }
  for (int x=0;x<n;x++) vs[x]=MP(g[x].size(),x);
  sort(vs,vs+n,greater<pii>());
	int slim=min(n,ms);
	memset(x2s,-1,sizeof x2s);
	for (int s=0;s<slim;s++) {
		int x=vs[s].snd; x2s[x]=s;
		for (auto &y:g[x]) b[s][y]=true;
	}
  for (int x=0;x<n;x++) sort(g[x].begin(),g[x].end());
  for (int x=0;x<n;x++) {
    for (auto &y:g[x]) {
    	uint lt=bins(g[y],x);
    	uint gt=g[y].size()-lt-1;
      if (y<x) {
        tl[x]+=lt;
        tm[x]+=gt;
      }
      else {
        tr[x]+=gt;
        tm[x]+=lt;
      }
    }
  }
	for (int xx=0;xx<n;xx++) {
    for (auto &yy:g[xx]) {
      if (xx>yy) continue;
      int x=xx,y=yy;
      if (g[x].size()>g[y].size()) swap(x,y);
      //assert(g[x].size()<=g[y].size());
      int s=x2s[y];
      if (s==-1) {
      	for (auto &z:g[x]) {
      	  if (binf(g[y],z)) {
      	    int state;
      	    if (z>x&&z>y) state=R;
      	    else if (z<x&&z<y) state=L;
      	    else state=M;
      	    ++tri[z][state];
      	  }
      	}
      }
      else {
      	for (auto &z:g[x]) {
      	  if (b[s][z]) {
      	    int state;
      	    if (z>x&&z>y) state=R;
      	    else if (z<x&&z<y) state=L;
      	    else state=M;
      	    ++tri[z][state];
      	  }
      	}
      }
    }
  }
  int el=0,er=m;
  for (int x=0;x<n;x++) {
    er-=vhi[x];
    ll em=m-el-er-g[x].size();
    // Code goes here
    ll al=x,ar=n-x-1;
    ll bl=vlo[x],br=vhi[x];
    ll gl=al-bl,gr=ar-br;
    { // x is leftmost
      ll one=br*gr+C2(br)+er;
      ll two=tr[x];
      ll three=tri[x][L];
      ll contrib=one-two+three;
      ll all=C2(ar);
      ans[L]+=(all-contrib)*x;
    }
    { // x is on rightmost
      ll one=bl*gl+C2(bl)+el;
      ll two=tl[x];
      ll three=tri[x][R];
      ll contrib=one-two+three;
      ll all=C2(al);
      ans[R]+=(all-contrib)*x;
    }
    { // mid x
      ll one=bl*gr+gl*br+bl*br+em;
      ll two=tm[x];
      ll three=tri[x][M];
      ll contrib=one-two+three;
      ll all=al*ar;
      ans[M]+=(all-contrib)*x;
    }
    // Ends here
    el+=vlo[x];
  }
  ll final=0;
  for (int i=0;i<3;i++) final+=ans[i]*C[i];
  printf("%llu\n",final);
}

static char stdinBuffer[1024];
static char* stdinDataEnd = stdinBuffer + sizeof (stdinBuffer);
static const char* stdinPos = stdinDataEnd;

void readAhead(size_t amount)
{
    size_t remaining = stdinDataEnd - stdinPos;
    if (remaining < amount) {
       memmove(stdinBuffer, stdinPos, remaining);
       size_t sz = fread(stdinBuffer + remaining, 1, sizeof (stdinBuffer) - remaining, stdin);
       stdinPos = stdinBuffer;
       stdinDataEnd = stdinBuffer + remaining + sz;
       if (stdinDataEnd != stdinBuffer + sizeof (stdinBuffer))
         *stdinDataEnd = 0;
    }
}

int rint()
{
    readAhead(16);

    int x = 0;
    bool neg = false;
    while(*stdinPos==' '||*stdinPos=='\n') ++stdinPos;
    if (*stdinPos == '-') {
       ++stdinPos;
       neg = true;
    }

    while (*stdinPos >= '0' && *stdinPos <= '9') {
       x *= 10;
       x += *stdinPos - '0';
       ++stdinPos;
    }

    return neg ? -x : x;
}
char rch()
{
    readAhead(16);
    while(*stdinPos==' '||*stdinPos=='\n') ++stdinPos;
    char ans=*stdinPos;
    ++stdinPos;
    return ans;
}
long long rlong()
{
    readAhead(32);

    long long x = 0;
    bool neg = false;
    while(*stdinPos==' '||*stdinPos=='\n') ++stdinPos;
    if (*stdinPos == '-') {
       ++stdinPos;
       neg = true;
    }

    while (*stdinPos >= '0' && *stdinPos <= '9') {
       x *= 10;
       x += *stdinPos - '0';
       ++stdinPos;
    }

    return neg ? -x : x;
}


#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,unsafe-math-optimizations")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,abm,mmx,avx,tune=native")
#include "bits/stdc++.h"
#include <assert.h>
#include <immintrin.h>
#include <emmintrin.h>
using namespace std;
typedef unsigned long long ll;
typedef long double ld;
typedef unsigned int uint;
#define PB push_back
#define MP make_pair
const int MOD=1000000007;
#define endl "\n"
#define fst first
#define snd second
const int UNDEF = -1;
const int INF=1<<30;
template<typename T> inline bool chkmax(T &aa, T bb) { return aa < bb ? aa = bb, true : false; }
template<typename T> inline bool chkmin(T &aa, T bb) { return aa > bb ? aa = bb, true : false; }
typedef pair<ll,ll> pll;typedef vector<ll> vll;typedef pair<int,int> pii;typedef vector<int> vi;typedef vector<vi> vvi;
#ifdef ONLINE_JUDGE
#define assert(...) /* nothing */
#endif
#define DEBUG_CAT
#ifdef DEBUG_CAT
#define dbg(...)   printf( __VA_ARGS__ )
#else
#define dbg(...)   /****nothing****/
#endif
int rint();char rch();long long rlong();
const int mn=(2e5)+4;
vi g[mn];
int bins(vector<int> &v, int key) {
  int imin=0,imax=v.size();
  while(imin<imax) {
    int imid=(imin+imax)>>1;
    if (v[imid]<key) imin=imid+1;
    else imax=imid;
  }
  return imin;

}

bool binf(vector<int> &v, int key) {
  int imin=bins(v,key);
  return (imin<v.size()) && (v[imin]==key);
}

ll C2(ll x) {
  ll a=x,b=x-1;
  if (a&1) b/=2;
  else a/=2;
  return a*b;
}
#define tm tmm
const int L=0,M=1,R=2;
ll tri[mn][3];
uint C[3];
uint vlo[mn],vhi[mn];
ll tl[mn],tm[mn],tr[mn];
ll ans[3];
int main()
{
  ios_base::sync_with_stdio(false); cin.tie(0);
  int n=rint(),m=rint();
  for (int i=0;i<3;i++) C[i]=rint();
  for (int i=0;i<m;i++) {
    int x=rint(),y=rint();
    g[x].PB(y);
    g[y].PB(x);
    vlo[max(x,y)]++;
    vhi[min(x,y)]++;
  }
  for (int x=0;x<n;x++) sort(g[x].begin(),g[x].end());
  for (int x=0;x<n;x++) {
    for (auto &y:g[x]) {
    	uint lt=bins(g[y],x);
    	uint gt=g[y].size()-lt-1;
      if (y<x) {
        tl[x]+=lt;
        tm[x]+=gt;
      }
      else {
        tr[x]+=gt;
        tm[x]+=lt;
      }
    }
  }
	for (int xx=0;xx<n;xx++) {
    for (auto &yy:g[xx]) {
      if (xx>yy) continue;
      int x=xx,y=yy;
      if (g[x].size()>g[y].size()) swap(x,y);
      assert(g[x].size()<=g[y].size());
      for (auto &z:g[x]) {
        if (binf(g[y],z)) {
          int s;
          if (z>x&&z>y) s=R;
          else if (z<x&&z<y) s=L;
          else s=M;
          ++tri[z][s];
        }
      }
    }
  }
  int el=0,er=m;
  for (int x=0;x<n;x++) {
    er-=vhi[x];
    ll em=m-el-er-g[x].size();
    // Code goes here
    ll al=x,ar=n-x-1;
    ll bl=vlo[x],br=vhi[x];
    ll gl=al-bl,gr=ar-br;
    { // x is leftmost
      ll one=br*gr+C2(br)+er;
      ll two=tr[x];
      ll three=tri[x][L];
      ll contrib=one-two+three;
      ll all=C2(ar);
      ans[L]+=(all-contrib)*x;
    }
    { // x is on rightmost
      ll one=bl*gl+C2(bl)+el;
      ll two=tl[x];
      ll three=tri[x][R];
      ll contrib=one-two+three;
      ll all=C2(al);
      ans[R]+=(all-contrib)*x;
    }
    { // mid x
      ll one=bl*gr+gl*br+bl*br+em;
      ll two=tm[x];
      ll three=tri[x][M];
      ll contrib=one-two+three;
      ll all=al*ar;
      ans[M]+=(all-contrib)*x;
    }
    // Ends here
    el+=vlo[x];
  }
  ll final=0;
  for (int i=0;i<3;i++) final+=ans[i]*C[i];
  printf("%llu\n",final);
}

static char stdinBuffer[1024];
static char* stdinDataEnd = stdinBuffer + sizeof (stdinBuffer);
static const char* stdinPos = stdinDataEnd;

void readAhead(size_t amount)
{
    size_t remaining = stdinDataEnd - stdinPos;
    if (remaining < amount) {
       memmove(stdinBuffer, stdinPos, remaining);
       size_t sz = fread(stdinBuffer + remaining, 1, sizeof (stdinBuffer) - remaining, stdin);
       stdinPos = stdinBuffer;
       stdinDataEnd = stdinBuffer + remaining + sz;
       if (stdinDataEnd != stdinBuffer + sizeof (stdinBuffer))
         *stdinDataEnd = 0;
    }
}

int rint()
{
    readAhead(16);

    int x = 0;
    bool neg = false;
    while(*stdinPos==' '||*stdinPos=='\n') ++stdinPos;
    if (*stdinPos == '-') {
       ++stdinPos;
       neg = true;
    }

    while (*stdinPos >= '0' && *stdinPos <= '9') {
       x *= 10;
       x += *stdinPos - '0';
       ++stdinPos;
    }

    return neg ? -x : x;
}
char rch()
{
    readAhead(16);
    while(*stdinPos==' '||*stdinPos=='\n') ++stdinPos;
    char ans=*stdinPos;
    ++stdinPos;
    return ans;
}
long long rlong()
{
    readAhead(32);

    long long x = 0;
    bool neg = false;
    while(*stdinPos==' '||*stdinPos=='\n') ++stdinPos;
    if (*stdinPos == '-') {
       ++stdinPos;
       neg = true;
    }

    while (*stdinPos >= '0' && *stdinPos <= '9') {
       x *= 10;
       x += *stdinPos - '0';
       ++stdinPos;
    }

    return neg ? -x : x;
}


#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,unsafe-math-optimizations")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,abm,mmx,avx,tune=native")
#include "bits/stdc++.h"
#include <assert.h>
#include <immintrin.h>
#include <emmintrin.h>
using namespace std;
typedef unsigned long long ll;
typedef long double ld;
typedef unsigned int uint;
#define PB push_back
#define MP make_pair
const int MOD=1000000007;
#define endl "\n"
#define fst first
#define snd second
const int UNDEF = -1;
const int INF=1<<30;
template<typename T> inline bool chkmax(T &aa, T bb) { return aa < bb ? aa = bb, true : false; }
template<typename T> inline bool chkmin(T &aa, T bb) { return aa > bb ? aa = bb, true : false; }
typedef pair<ll,ll> pll;typedef vector<ll> vll;typedef pair<int,int> pii;typedef vector<int> vi;typedef vector<vi> vvi;
#ifdef ONLINE_JUDGE
#define assert(...) /* nothing */
#endif
#define DEBUG_CAT
#ifdef DEBUG_CAT
#define dbg(...)   printf( __VA_ARGS__ )
#else
#define dbg(...)   /****nothing****/
#endif
int rint();char rch();long long rlong();
const int mn=(2e5)+4;
vi g[mn];
int bins(vector<int> &v, int key) {
  int imin=0,imax=v.size();
  while(imin<imax) {
    int imid=(imin+imax)>>1;
    if (v[imid]<key) imin=imid+1;
    else imax=imid;
  }
  return imin;

}

bool binf(vector<int> &v, int key) {
  int imin=bins(v,key);
  return (imin<v.size()) && (v[imin]==key);
}

ll C2(ll x) {
  ll a=x,b=x-1;
  if (a&1) b/=2;
  else a/=2;
  return a*b;
}
#define tm tmm
const int L=0,M=1,R=2;
uint tri[mn][3];
uint C[3];
uint vlo[mn],vhi[mn];
ll tl[mn],tm[mn],tr[mn];
ll ans[3];
int main()
{
  ios_base::sync_with_stdio(false); cin.tie(0);
  int n=rint(),m=rint();
  for (int i=0;i<3;i++) C[i]=rint();
  for (int i=0;i<m;i++) {
    int x=rint(),y=rint();
    g[x].PB(y);
    g[y].PB(x);
    vlo[max(x,y)]++;
    vhi[min(x,y)]++;
  }
  for (int x=0;x<n;x++) sort(g[x].begin(),g[x].end());
  for (int x=0;x<n;x++) {
    for (auto &y:g[x]) {
      if (y<x) {
      	int lt=vlo[y];
      	int gt=g[y].size()-bins(g[y],x+1);
      	//if (x==5&&lt) printf("y:%d lt:%d\n",y,lt);
        tl[x]+=lt;
        tm[x]+=gt;
      }
      else {
      	int gt=vhi[y];
        tr[x]+=gt;
        //if (x==5&&lt) printf("SND\n");
        //tm[x]+=lt;
      }
    }
  }
  /*for (int xx=0;xx<n;xx++) {
    for (auto &yy:g[xx]) {
      if (xx>yy) continue;
      int x=xx,y=yy;
      if (g[x].size()>g[y].size()) swap(x,y);
      for (auto &z:g[x]) {
        if (binf(g[y],z)) {
          int s=L;
          if (z>y) s=R;
          else if (z>x) s=M;
          ++tri[z][s];
        }
      }
    }
  }*/
  int el=0,er=m;
  for (int x=0;x<n;x++) {
    er-=vhi[x];
    ll em=m-el-er-g[x].size();
    //printf("x:%d em:%lld\n",x,em);
    // Code goes here
    ll al=x,ar=n-x-1;
    ll bl=vlo[x],br=vhi[x];
    ll gl=al-bl,gr=ar-br;
    { // x is leftmost
      ll one=br*gr+C2(br)+er;
      ll two=tr[x];
      ll three=tri[x][L];
      ll contrib=one-two+three;
      //printf("br:%d ar:%d er:%d\n",br,ar,er);
      //printf("one:%lld two:%lld three:%lld\n",one,two,three);
      ll all=C2(ar);
      //printf("leftmost x:%d contrib:%llu all:%llu ar:%llu\n",x,contrib,all,ar);
      //printf("leftmost x:%d add:%lld\n",x,all-contrib);
      ans[L]+=(all-contrib)*x;
    }
    { // x is on rightmost
      ll one=bl*gl+C2(bl)+el;
      ll two=tl[x];
      ll three=tri[x][R];
      ll contrib=one-two+three;
      ll all=C2(al);
      //printf("one:%lld two:%lld three:%lld all:%lld bl:%lld al:%lld el:%lld\n",one,two,three,all,bl,al,el);
      //printf("rightmost x:%d contrib:%llu all:%llu\n",x,contrib,all);
      //printf("rightmost x:%d add:%lld\n",x,all-contrib);
      ans[R]+=(all-contrib)*x;
    }
    { // mid x
      ll one=bl*gr+gl*br+bl*br+em;
      ll two=tm[x];
      ll three=tri[x][M];
      ll contrib=one-two+three;
      ll all=al*ar;
      //printf("middle x:%d contrib:%lld all:%lld\n",x,contrib,all);
      //printf("one:%lld two:%lld three:%lld all:%lld\n",one,two,three,all);
      //printf("mid x:%d add:%lld\n",x,all-contrib);
      ans[M]+=(all-contrib)*x;
    }
    // Ends here
    el+=vlo[x];
  }
  ll final=0;
  for (int i=0;i<3;i++) final+=ans[i]*C[i];
  printf("%llu\n",final);
}

inline int rint() {
  int x; scanf("%d",&x); return x;
}


#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,unsafe-math-optimizations")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,abm,mmx,avx,tune=native")
#include "bits/stdc++.h"
#include <assert.h>
#include <immintrin.h>
#include <emmintrin.h>
using namespace std;
typedef unsigned long long ll;
typedef long double ld;
typedef unsigned int uint;
#define PB push_back
#define MP make_pair
const int MOD=1000000007;
#define endl "\n"
#define fst first
#define snd second
const int UNDEF = -1;
const int INF=1<<30;
template<typename T> inline bool chkmax(T &aa, T bb) { return aa < bb ? aa = bb, true : false; }
template<typename T> inline bool chkmin(T &aa, T bb) { return aa > bb ? aa = bb, true : false; }
typedef pair<ll,ll> pll;typedef vector<ll> vll;typedef pair<int,int> pii;typedef vector<int> vi;typedef vector<vi> vvi;
#ifdef ONLINE_JUDGE
#define assert(...) /* nothing */
#endif
#define DEBUG_CAT
#ifdef DEBUG_CAT
#define dbg(...)   printf( __VA_ARGS__ )
#else
#define dbg(...)   /****nothing****/
#endif
int rint();char rch();long long rlong();
const int mn=(2e5)+4;
vi g[mn];
int bins(vector<int> &v, int key) {
  int imin=0,imax=v.size();
  while(imin<imax) {
    int imid=(imin+imax)>>1;
    if (v[imid]<key) imin=imid+1;
    else imax=imid;
  }
  return imin;

}

bool binf(vector<int> &v, int key) {
  int imin=bins(v,key);
  return (imin<v.size()) && (v[imin]==key);
}

ll C2(ll x) {
  ll a=x,b=x-1;
  if (a&1) b/=2;
  else a/=2;
  return a*b;
}
#define tm tmm
const int L=0,M=1,R=2;
ll tri[mn][3];
uint C[3];
uint vlo[mn],vhi[mn];
ll tl[mn],tm[mn],tr[mn];
ll ans[3];
//bool h[30][30];
int main()
{
  ios_base::sync_with_stdio(false); cin.tie(0);
  int n=rint(),m=rint();
  for (int i=0;i<3;i++) C[i]=rint();
  for (int i=0;i<m;i++) {
    int x=rint(),y=rint();
    //h[x][y]=h[y][x]=true;
    g[x].PB(y);
    g[y].PB(x);
    vlo[max(x,y)]++;
    vhi[min(x,y)]++;
  }
  for (int x=0;x<n;x++) sort(g[x].begin(),g[x].end());
  for (int x=0;x<n;x++) {
    for (auto &y:g[x]) {
      if (y<x) {
      	//if (x==5&&lt) printf("y:%d lt:%d\n",y,lt);
        tl[x]+=bins(g[y],x);
        tm[x]+=g[y].size()-bins(g[y],x+1);
      }
      else {
        tr[x]+=g[y].size()-bins(g[y],x+1);
        tm[x]+=bins(g[y],x);
      }
    }
  }
	for (int xx=0;xx<n;xx++) {
    for (auto &yy:g[xx]) {
      if (xx>yy) continue;
      int x=xx,y=yy;
      if (g[x].size()>g[y].size()) swap(x,y);
      for (auto &z:g[x]) {
        if (binf(g[y],z)) {
          int s;
          if (z>x&&z>y) s=R;
          else if (z<x&&z<y) s=L;
          else s=M;
          ++tri[z][s];
        }
      }
    }
  }
  int el=0,er=m;
  for (int x=0;x<n;x++) {
    er-=vhi[x];
    ll em=m-el-er-g[x].size();
    //printf("x:%d em:%lld\n",x,em);
    // Code goes here
    ll al=x,ar=n-x-1;
    ll bl=vlo[x],br=vhi[x];
    ll gl=al-bl,gr=ar-br;
    { // x is leftmost
      ll one=br*gr+C2(br)+er;
      ll two=tr[x];
      ll three=tri[x][L];
      ll contrib=one-two+three;
      /*ll test=0;
      for (int i=x+1;i<n;i++) {
      	for (int j=i+1;j<n;j++) {
      		if (h[x][i]||h[x][j]||h[i][j]) ++test;
      	}
      }
      if (test!=contrib) {
      	printf("x:%d test:%lld contrib:%lld\n",x,test,contrib);
      	printf("one:%lld two:%lld three:%lld er:%d\n",one,two,three,er);
      	assert(test==contrib);
      }*/
      //printf("br:%d ar:%d er:%d\n",br,ar,er);

      ll all=C2(ar);
      //printf("leftmost x:%d contrib:%llu all:%llu ar:%llu\n",x,contrib,all,ar);
      //printf("leftmost x:%d add:%lld\n",x,all-contrib);
      ans[L]+=(all-contrib)*x;
    }
    { // x is on rightmost
      ll one=bl*gl+C2(bl)+el;
      ll two=tl[x];
      ll three=tri[x][R];
      ll contrib=one-two+three;
      ll all=C2(al);
      /*ll test=0;
      for (int i=0;i<x;i++) {
      	for (int j=i+1;j<x;j++) {
      		if (h[x][i]||h[x][j]||h[i][j]) ++test;
      	}
      }
      if (test!=contrib) {
      	printf("x:%d test:%lld contrib:%lld\n",x,test,contrib);
      	printf("one:%lld two:%lld three:%lld er:%d\n",one,two,three,er);
      	assert(test==contrib);
      }*/
      //printf("one:%lld two:%lld three:%lld all:%lld bl:%lld al:%lld el:%lld\n",one,two,three,all,bl,al,el);
      //printf("rightmost x:%d contrib:%llu all:%llu\n",x,contrib,all);
      //printf("rightmost x:%d add:%lld\n",x,all-contrib);
      ans[R]+=(all-contrib)*x;
    }
    { // mid x
      ll one=bl*gr+gl*br+bl*br+em;
      ll two=tm[x];
      ll three=tri[x][M];
      ll contrib=one-two+three;
      /*ll test=0;
      for (int i=0;i<x;i++) {
      	for (int j=x+1;j<n;j++) {
      		if (h[x][i]||h[x][j]||h[i][j]) ++test;
      	}
      }
      if (test!=contrib) {
      	printf("x:%d test:%lld contrib:%lld\n",x,test,contrib);
      	printf("one:%lld two:%lld three:%lld er:%d\n",one,two,three,er);
      	assert(test==contrib);
      }*/
      ll all=al*ar;
      //printf("middle x:%d contrib:%lld all:%lld\n",x,contrib,all);
      //printf("one:%lld two:%lld three:%lld all:%lld\n",one,two,three,all);
      //printf("mid x:%d add:%lld\n",x,all-contrib);
      ans[M]+=(all-contrib)*x;
    }
    // Ends here
    el+=vlo[x];
  }
  ll final=0;
  for (int i=0;i<3;i++) final+=ans[i]*C[i];
  printf("%llu\n",final);
}

inline int rint() {
  int x; scanf("%d",&x); return x;
}


#include<cstdio>
#include<algorithm>
#include<vector>
#define ull unsigned long long
#define maxn 200050
using namespace std;
vector<int>E[maxn];
ull c[maxn],a[maxn];
ull ans=0;
int x[maxn],y[maxn],goin[maxn],v[maxn];
ull suml[maxn],sumr[maxn],l[maxn],r[maxn];
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	ull A,B,C;
	scanf("%llu%llu%llu",&A,&B,&C);
	for (int i=1;i<n;i++)
	a[i]=a[i-1]+A*i;
	for (int i=n-1;i>=0;i--)
	c[i]=c[i+1]+C*i;
	for (int i=1;i<n;i++)
	ans+=i*(n-i-1)*B*i+a[i-1]*(n-i-1)+c[i+1]*i;
	for (int i=1;i<=m;i++)
		scanf("%d%d",&x[i],&y[i]),goin[x[i]]++,goin[y[i]]++;
	for (int i=1;i<=m;i++){
		if (goin[x[i]]<goin[y[i]]||(goin[x[i]]==goin[y[i]]&&x[i]<y[i])) swap(x[i],y[i]);
		E[x[i]].push_back(y[i]);
		//有一对冲突
		int a=x[i],b=y[i];
		if (a>b) swap(a,b);
		if (a>1) ans-=(B*a+C*b)*a+A*a*(a-1)/2;
		if (b<n-1)ans-=(A*a+B*b)*(n-1-b)+C*(b+n)*(n-b-1)/2;
		ans-=(A*a+C*b)*(b-a-1)+B*(a+b)*(b-a-1)/2;
		r[a]++,sumr[a]+=C*b;
		l[b]++,suml[b]+=A*a;
	}
	//有两对冲突
	for (int i=1;i<n-1;i++)
		ans+=l[i]*r[i]*B*i+suml[i]*r[i]+sumr[i]*l[i];
	for (int i=0;i<n;i++){
		for (int j=0;j<E[i].size();j++)
		v[E[i][j]]=i+1;
		for (int j=0;j<E[i].size();j++){
			int y=E[i][j];
			for (int k=0;k<E[y].size();k++)
			if (v[E[y][k]]==i+1) {
				int a=i,b=y,c=E[y][k];
				if (c<a) swap(c,a);
				if (b<a) swap(b,a);
				if (c<b) swap(c,b);
				ans+=A*a+B*b+C*c;//有三对冲突
			}
		}
	}
	printf("%llu",ans);
	return 0;
}
/*
容斥，三元环计数
考虑容斥，先求出所有的选择总和
ans=all-有一对冲突+有两对冲突+有三对冲突

*/


#include<cstdio>
#include<algorithm>
#include<vector>
#define ull unsigned long long
#define maxn 200050
using namespace std;
vector<int>E[maxn],G[maxn];
ull c[maxn],a[maxn],now[maxn];
ull ans=0;
int x[maxn],y[maxn],goin[maxn],v[maxn];
ull suml[maxn],sumr[maxn],l[maxn],r[maxn];
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	ull A,B,C;
	scanf("%llu%llu%llu",&A,&B,&C);
	for (int i=1;i<n;i++)
	a[i]=a[i-1]+A*i;
	for (int i=n-1;i>=0;i--)
	c[i]=c[i+1]+C*i;
	for (int i=1;i<n;i++)
	ans+=i*(n-i-1)*B*i+a[i-1]*(n-i-1)+c[i+1]*i;
//	printf("%llu\n",ans);
	for (int i=1;i<=m;i++)
		scanf("%d%d",&x[i],&y[i]),goin[x[i]]++,goin[y[i]]++;
	for (int i=1;i<=m;i++){
		if (goin[x[i]]<goin[y[i]]||(goin[x[i]]==goin[y[i]]&&x[i]<y[i])) swap(x[i],y[i]);
		E[x[i]].push_back(y[i]);
		G[x[i]].push_back(y[i]);
		G[y[i]].push_back(x[i]);
		//有一对冲突
		int a=x[i],b=y[i];
		if (a>b) swap(a,b);
		ans-=(B*a+C*b)*a+A*a*(a-1)/2;
		ans-=(A*a+B*b)*(n-1-b)+C*(b+n)*(n-b-1)/2;
		ans-=(A*a+C*b)*(b-a-1)+B*(a+b)*(b-a-1)/2;
		//printf("%llu %llu %llu\n",(B*a+C*b)*a+A*a*(a-1)/2,(A*a+B*b)*(n-1-b)+C*(b+n)*(n-b-1)/2,(A*a+C*b)*(b-a-1)+B*(a+b)*(b-a-1)/2);
		r[a]++,sumr[a]+=C*b;
		l[b]++,suml[b]+=A*a;
	}
//	printf("%llu\n",ans);
	//有两对冲突
	for (int i=0;i<n;i++)
		ans+=l[i]*r[i]*B*i+suml[i]*r[i]+sumr[i]*l[i];
	for (int i=0;i<n;i++){
		int z=G[i].size();
		for (int j=0;j<z;j++)
		now[j]=G[i][j];
		sort(now,now+z);
		c[z]=0;
		a[0]=now[0]*A;
		for (int j=z-1;j>=0;j--)
		c[j]=c[j+1]+C*now[j];
		for (int j=1;j<z;j++)
		a[j]=a[j-1]+A*now[j];
		for (int j=0;j<z;j++){
			if (now[j]<i&&j) ans+=a[j-1]+now[j]*B*j+C*i*j;
			if (now[j]>i) ans+=c[j+1]+now[j]*B*(z-j-1)+A*i*(z-j-1);
		}
	}
	//printf("%llu\n",ans);
	for (int i=0;i<n;i++){
		for (int j=0;j<E[i].size();j++)
		v[E[i][j]]=i+1;
		for (int j=0;j<E[i].size();j++){
			int y=E[i][j];
			for (int k=0;k<E[y].size();k++)
			if (v[E[y][k]]==i+1) {
				int a=i,b=y,c=E[y][k];
				if (c<a) swap(c,a);
				if (b<a) swap(b,a);
				if (c<b) swap(c,b);
				ans-=A*a+B*b+C*c;//有三对冲突

			}
		}
	}
	printf("%llu",ans);
	return 0;
}
/*
容斥，三元环计数
考虑容斥，先求出所有的选择总和
ans=all-有一对冲突+有两对冲突+有三对冲突

*/


#include<cstdio>
#include<algorithm>
#include<vector>
#define ull unsigned long long
#define maxn 200050
using namespace std;
vector<int>E[maxn],G[maxn];
ull c[maxn],a[maxn],now[maxn];
ull ans=0;
int x[maxn],y[maxn],goin[maxn],v[maxn];
ull suml[maxn],sumr[maxn],l[maxn],r[maxn];
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	ull A,B,C;
	scanf("%llu%llu%llu",&A,&B,&C);
	for (int i=1;i<n;i++)
	a[i]=a[i-1]+A*i;
	for (int i=n-1;i>=0;i--)
	c[i]=c[i+1]+C*i;
	for (ull i=1;i<n;i++)
	ans+=i*(n-i-1)*B*i+a[i-1]*(n-i-1)+c[i+1]*i;
//	printf("%llu\n",ans);
	for (int i=1;i<=m;i++)
		scanf("%d%d",&x[i],&y[i]),goin[x[i]]++,goin[y[i]]++;
	for (int i=1;i<=m;i++){
		if (goin[x[i]]<goin[y[i]]||(goin[x[i]]==goin[y[i]]&&x[i]<y[i])) swap(x[i],y[i]);
		E[x[i]].push_back(y[i]);
		G[x[i]].push_back(y[i]);
		G[y[i]].push_back(x[i]);
		//有一对冲突
		ull a=x[i],b=y[i];
		if (a>b) swap(a,b);
		ans-=(B*a+C*b)*a+A*a*(a-1)/2;
		ans-=(A*a+B*b)*(n-1-b)+C*(b+n)*(n-b-1)/2;
		ans-=(A*a+C*b)*(b-a-1)+B*(a+b)*(b-a-1)/2;
		//printf("%llu %llu %llu\n",(B*a+C*b)*a+A*a*(a-1)/2,(A*a+B*b)*(n-1-b)+C*(b+n)*(n-b-1)/2,(A*a+C*b)*(b-a-1)+B*(a+b)*(b-a-1)/2);
		r[a]++,sumr[a]+=C*b;
		l[b]++,suml[b]+=A*a;
	}
//	printf("%llu\n",ans);
	//有两对冲突
	for (int i=0;i<n;i++)
		ans+=l[i]*r[i]*B*i+suml[i]*r[i]+sumr[i]*l[i];
	for (int i=0;i<n;i++){
		int z=G[i].size();
		for (int j=0;j<z;j++)
		now[j]=G[i][j];
		sort(now,now+z);
		c[z]=0;
		a[0]=now[0]*A;
		for (int j=z-1;j>=0;j--)
		c[j]=c[j+1]+C*now[j];
		for (int j=1;j<z;j++)
		a[j]=a[j-1]+A*now[j];
		for (ull j=0;j<z;j++){
			if (now[j]<i&&j) ans+=a[j-1]+now[j]*B*j+C*i*j;
			if (now[j]>i) ans+=c[j+1]+now[j]*B*(z-j-1)+A*i*(z-j-1);
		}
	}
	//printf("%llu\n",ans);
	for (int i=0;i<n;i++){
		for (int j=0;j<E[i].size();j++)
		v[E[i][j]]=i+1;
		for (int j=0;j<E[i].size();j++){
			int y=E[i][j];
			for (int k=0;k<E[y].size();k++)
			if (v[E[y][k]]==i+1) {
				int a=i,b=y,c=E[y][k];
				if (c<a) swap(c,a);
				if (b<a) swap(b,a);
				if (c<b) swap(c,b);
				ans-=A*a+B*b+C*c;//有三对冲突

			}
		}
	}
	printf("%llu",ans);
	return 0;
}
/*
容斥，三元环计数
考虑容斥，先求出所有的选择总和
ans=all-有一对冲突+有两对冲突+有三对冲突

*/


/*
Author: Snickeen.
Email : ff@snickeen.com

If you find out some bugs, please tell me. Thank you.
*/
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#include<ext/pb_ds/tree_policy.hpp>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/rope>
#include<bits/stdc++.h>
using namespace std;
//using namespace __gnu_cxx;

typedef unsigned long long LL;
typedef double db;
typedef pair<LL,LL> PLL;

const db PI = acos(-1.0);
const db eps = 1e-9;
const LL MOD = 1e9+7;
const LL INF = 1e18+7;
const LL MAXN = 1e6+7;

#define all(x) (x).begin(),(x).end()

/******************************************************/

LL n,m,A,B,C,ans;
LL d[MAXN];
map<LL,LL> mp[MAXN];
vector<PLL> f;
vector<LL> g[MAXN],l[MAXN],r[MAXN], low,high;
char vis[MAXN];

signed main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);//cout<<fixed<<setprecision(9);
    LL i,j,k,mid,u,v,w,res;
    cin>>n>>m>>A>>B>>C;
    for(i=1;i<=m;i++){
        cin>>u>>v;
        mp[u][v]=1;
        mp[v][u]=1;
        g[u].push_back(v);
        g[v].push_back(u);
        d[u]++;d[v]++;
        f.push_back({u,v});
    }
    sort(f.begin(),f.end(),[](PLL a,PLL b){
            return a.first<b.first || (a.first==b.first&&a.second<b.second);
         });
    for(auto x:f){
        l[x.second].push_back(x.first);
        r[x.first].push_back(x.second);
    }

    //0
    res=0;
    for(i=1;i<n-1;i++){
        u=(i+1)*i/2-i;
        v=(n-1)*n/2-u-i;
        res+=A*u*(n-1-i)+B*i*(i)*(n-1-i)+C*v*(i);
    }
    ans+=res;

    //1
    res=0;
    for(i=0;i<m;i++){
        u=x.first*(x.first+1)/2-x.first;
        res+=A*u+B*x.first*(x.first-1)+C*x.second*(x.first-1);
        u=(x.first+x.second)*(x.second-x.first+1)/2-x.first-x.second;
        res+=A*x.first*(x.second-x.first-1)+B*u+C*x.second*(x.second-x.first-1);
        u=(n-1+x.second)*(n-1-x.second+1)/2-x.second;
        res+=A*x.first*(n-1-x.second)+B*x.second*(n-1-x.second)+C*u;
    }
    ans-=res;

    //2
    res=0;
    LL suml,sumr,cntl,cntr,len;
    for(i=1;i<n-1;i++){
        sort(all(l[i]));sort(all(r[i]));
        len=l[i].size();
        if(len){
            suml=l[i][0];cntl=1;
            for(j=1;j<len;j++){
                res+=A*suml+B*l[i][j]*cntl+C*i*cntl;
                suml+=l[i][j];
                cntl++;
            }
        }
        len=r[i].size();
        if(len){
            sumr=r[i][0];cntr=1;
            for(j=1;j<len;j++){
                res+=A*i*cntr+B*sumr+B*r[i][j]*cntr+;
                sumr+=r[i][j];
                cntr++;
            }
        }
        res+=A*suml*cntr+B*i*cntl*cntr+C*sumr*cntl;
    }
    ans+=res;

    //3
    res=0;
    for(i=1; i<=n; i++){
        if(d[i]<=sqrt(m)) low.push_back(i);
        else high.push_back(i);
    }
    LL lenlow,lenhigh,x,y,z;
    lenlow=low.size();
    for(i=0; i<lenow; i++){
        x = low[i];
        vis[x] = 1;
        len=g[x].size();
        for(j=0; j<len; j++){
            y = g[x][j];
            if(vis[y]) continue;
            for(k=j+1; k<len; k++){
                z = g[x][k];
                if(vis[z]) continue;
                if(mp[y].count(z)){
                    LL xx,yy,zz;
                    xx=min(min(x,y),z);
                    zz=max(max(x,y),z);
                    yy=x+y+z-xx-zz;
                    res+=A*xx+B*yy+C*zz;
                }
            }
        }
    }
    lenhigh=high.size();
    for(i=0; i<lenhigh; i++){
        for(j=i+1; j<lenhigh; j++){
            x = high[i];
            y = high[j];
            if(mp[x].count(y)==0) continue;
            for(k=j+1; k<lenhigh; k++){
                z = high[k];
                if(mp[y].count(z)&&mp[x].count(z)) {
                    LL xx,yy,zz;
                    xx=min(min(x,y),z);
                    zz=max(max(x,y),z);
                    yy=x+y+z-xx-zz;
                    res+=A*xx+B*yy+C*zz;
                }
            }
        }
    }
    ans-=res;

    cout<<ans<<endl;

    return 0;
}


/*
Author: Snickeen.
Email : ff@snickeen.com

If you find out some bugs, please tell me. Thank you.
*/
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#include<ext/pb_ds/tree_policy.hpp>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/rope>
#include<bits/stdc++.h>
using namespace std;
//using namespace __gnu_cxx;

typedef unsigned long long LL;
typedef double db;
typedef pair<LL,LL> PLL;

const db PI = acos(-1.0);
const db eps = 1e-9;
const LL MOD = 1e9+7;
const LL INF = 1e18+7;
const LL MAXN = 1e6+7;

#define all(x) (x).begin(),(x).end()

/******************************************************/

LL n,m,A,B,C,ans;
LL d[MAXN];
map<LL,LL> mp[MAXN];
vector<PLL> f;
vector<LL> g[MAXN],l[MAXN],r[MAXN], low,high;
char vis[MAXN];

signed main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);//cout<<fixed<<setprecision(9);
    LL i,j,k,mid,u,v,w,res;
    cin>>n>>m>>A>>B>>C;
    for(i=1;i<=m;i++){
        cin>>u>>v;
        mp[u][v]=1;
        mp[v][u]=1;
        g[u].push_back(v);
        g[v].push_back(u);
        d[u]++;d[v]++;
        f.push_back({min(u,v),max(u,v)});
    }
    sort(f.begin(),f.end(),[](PLL a,PLL b){
            return a.first<b.first || (a.first==b.first&&a.second<b.second);
         });
    for(auto x:f){
        l[x.second].push_back(x.first);
        r[x.first].push_back(x.second);
    }

    //0
    res=0;
    for(i=1;i<n-1;i++){
        u=(i+1)*i/2-i;
        v=(n-1)*n/2-u-i;
        res+=A*u*(n-1-i)+B*i*(i)*(n-1-i)+C*v*(i);
    }
    ans+=res;
    //cout<<res<<" "<<ans<<endl;

    //1
    res=0;
    for(i=0;i<m;i++){
        PLL x=f[i];
        u=x.first*(x.first+1)/2-x.first;
        if(x.first)res+=A*u+B*x.first*(x.first-1)+C*x.second*(x.first-1);
        u=(x.first+x.second)*(x.second-x.first+1)/2-x.first-x.second;
        res+=A*x.first*(x.second-x.first-1)+B*u+C*x.second*(x.second-x.first-1);
        u=(n-1+x.second)*(n-1-x.second+1)/2-x.second;
        res+=A*x.first*(n-1-x.second)+B*x.second*(n-1-x.second)+C*u;
    }
    ans-=res;
    //cout<<res<<" "<<ans<<endl;

    //2
    res=0;
    LL suml=0,sumr=0,cntl=0,cntr=0,len;
    for(i=1;i<n-1;i++){
        sort(all(l[i]));sort(all(r[i]));
        len=l[i].size();
        if(len){
            suml=l[i][0];cntl=1;
            for(j=1;j<len;j++){
                res+=A*suml+B*l[i][j]*cntl+C*i*cntl;
                suml+=l[i][j];
                cntl++;
            }
        }
        len=r[i].size();
        if(len){
            sumr=r[i][0];cntr=1;
            for(j=1;j<len;j++){
                res+=A*i*cntr+B*sumr+C*r[i][j]*cntr;
                sumr+=r[i][j];
                cntr++;
            }
        }
        res+=A*suml*cntr+B*i*cntl*cntr+C*sumr*cntl;
    }
    ans+=res;
    //cout<<res<<" "<<ans<<endl;

    //3
    res=0;
    for(i=1; i<=n; i++){
        if(d[i]<=sqrt(m)) low.push_back(i);
        else high.push_back(i);
    }
    LL lenlow,lenhigh,x,y,z;
    lenlow=low.size();
    for(i=0; i<lenlow; i++){
        x = low[i];
        vis[x] = 1;
        len=g[x].size();
        for(j=0; j<len; j++){
            y = g[x][j];
            if(vis[y]) continue;
            for(k=j+1; k<len; k++){
                z = g[x][k];
                if(vis[z]) continue;
                if(mp[y].count(z)){
                    LL xx,yy,zz;
                    xx=min(min(x,y),z);
                    zz=max(max(x,y),z);
                    yy=x+y+z-xx-zz;
                    res+=A*xx+B*yy+C*zz;
                }
            }
        }
    }
    lenhigh=high.size();
    for(i=0; i<lenhigh; i++){
        for(j=i+1; j<lenhigh; j++){
            x = high[i];
            y = high[j];
            if(mp[x].count(y)==0) continue;
            for(k=j+1; k<lenhigh; k++){
                z = high[k];
                if(mp[y].count(z)&&mp[x].count(z)) {
                    LL xx,yy,zz;
                    xx=min(min(x,y),z);
                    zz=max(max(x,y),z);
                    yy=x+y+z-xx-zz;
                    res+=A*xx+B*yy+C*zz;
                }
            }
        }
    }
    ans-=res;
    //cout<<res<<" "<<ans<<endl;

    cout<<ans<<endl;

    return 0;
}


/*
Author: Snickeen.
Email : ff@snickeen.com

If you find out some bugs, please tell me. Thank you.
*/
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#include<ext/pb_ds/tree_policy.hpp>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/rope>
#include<bits/stdc++.h>
using namespace std;
//using namespace __gnu_cxx;

typedef unsigned long long LL;
typedef double db;
typedef pair<LL,LL> PLL;

const db PI = acos(-1.0);
const db eps = 1e-9;
const LL MOD = 1e9+7;
const LL INF = 1e18+7;
const LL MAXN = 1e6+7;

#define all(x) (x).begin(),(x).end()

/******************************************************/

LL n,m,A,B,C,ans;
LL d[MAXN];
map<LL,LL> mp[MAXN];
vector<PLL> f;
vector<LL> g[MAXN],l[MAXN],r[MAXN], low,high;
char vis[MAXN];

signed main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);//cout<<fixed<<setprecision(9);
    LL i,j,k,mid,u,v,w,res;
    cin>>n>>m>>A>>B>>C;
    for(i=1;i<=m;i++){
        cin>>u>>v;
        mp[u][v]=1;
        mp[v][u]=1;
        g[u].push_back(v);
        g[v].push_back(u);
        d[u]++;d[v]++;
        f.push_back({min(u,v),max(u,v)});
    }
    sort(f.begin(),f.end(),[](PLL a,PLL b){
            return a.first<b.first || (a.first==b.first&&a.second<b.second);
         });
    for(auto x:f){
        l[x.second].push_back(x.first);
        r[x.first].push_back(x.second);
    }

    //0
    res=0;
    for(i=1;i<n-1;i++){
        u=(i+1)*i/2-i;
        v=(n-1)*n/2-u-i;
        res+=A*u*(n-1-i)+B*i*(i)*(n-1-i)+C*v*(i);
        //cout<<i<<" "<<res<<endl;
    }
    ans+=res;
    //cout<<res<<" "<<ans<<endl;

    //1
    res=0;
    for(i=0;i<m;i++){
        PLL x=f[i];
        u=x.first*(x.first+1)/2-x.first;
        res+=A*u+B*x.first*(x.first>=1?x.first:0ull)+C*x.second*(x.first>=1?x.first:0ull);
        //cout<<u<<" "<<res<<" ";
        u=(x.first+x.second)*(x.second-x.first+1)/2-x.first-x.second;
        res+=A*x.first*(x.second-x.first-1)+B*u+C*x.second*(x.second-x.first-1);
        //cout<<u<<" "<<res<<" ";
        u=(n-1+x.second)*(n-1-x.second+1)/2-x.second;
        res+=A*x.first*(n-1-x.second)+B*x.second*(n-1-x.second)+C*u;
        //cout<<i<<" "<<res<<endl;
    }
    ans-=res;
    //cout<<res<<" "<<ans<<endl;

    //2
    res=0;
    LL suml=0,sumr=0,cntl=0,cntr=0,len;
    for(i=0;i<n;i++){
        suml=sumr=cntl=cntr=0;
        //sort(all(l[i]));sort(all(r[i]));
        len=l[i].size();
        if(len){
            suml=l[i][0];cntl=1;
            for(j=1;j<len;j++){
                res+=A*suml+B*l[i][j]*cntl+C*i*cntl;
                suml+=l[i][j];
                cntl++;
            }
        }
        len=r[i].size();
        if(len){
            sumr=r[i][0];cntr=1;
            for(j=1;j<len;j++){
                res+=A*i*cntr+B*sumr+C*r[i][j]*cntr;
                sumr+=r[i][j];
                cntr++;
            }
        }
        res+=(A*suml*cntr+B*i*cntl*cntr+C*sumr*cntl)*(cntr>0&&cntl>0);
        //cout<<i<<":"<<res<<endl;
    }
    ans+=res;
    //cout<<res<<" "<<ans<<endl;

    //3
    res=0;
    for(i=1; i<=n; i++){
        if(d[i]<=sqrt(m)) low.push_back(i);
        else high.push_back(i);
    }
    LL lenlow,lenhigh,x,y,z;
    lenlow=low.size();
    for(i=0; i<lenlow; i++){
        x = low[i];
        vis[x] = 1;
        len=g[x].size();
        for(j=0; j<len; j++){
            y = g[x][j];
            if(vis[y]) continue;
            for(k=j+1; k<len; k++){
                z = g[x][k];
                if(vis[z]) continue;
                if(mp[y].count(z)){
                    LL xx,yy,zz;
                    xx=min(min(x,y),z);
                    zz=max(max(x,y),z);
                    yy=x+y+z-xx-zz;
                    res+=A*xx+B*yy+C*zz;
                }
            }
        }
    }
    lenhigh=high.size();
    for(i=0; i<lenhigh; i++){
        for(j=i+1; j<lenhigh; j++){
            x = high[i];
            y = high[j];
            if(mp[x].count(y)==0) continue;
            for(k=j+1; k<lenhigh; k++){
                z = high[k];
                if(mp[y].count(z)&&mp[x].count(z)) {
                    LL xx,yy,zz;
                    xx=min(min(x,y),z);
                    zz=max(max(x,y),z);
                    yy=x+y+z-xx-zz;
                    res+=A*xx+B*yy+C*zz;
                }
            }
        }
    }
    ans-=res;
    //cout<<res<<" "<<ans<<endl;

    cout<<ans<<endl;

    return 0;
}


/*
Author: Snickeen.
Email : ff@snickeen.com

If you find out some bugs, please tell me. Thank you.
*/
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#include<ext/pb_ds/tree_policy.hpp>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/rope>
#include<bits/stdc++.h>
using namespace std;
//using namespace __gnu_cxx;

typedef unsigned long long LL;
typedef double db;
typedef pair<LL,LL> PLL;

const db PI = acos(-1.0);
const db eps = 1e-9;
const LL MOD = 1e9+7;
const LL INF = 1e18+7;
const LL MAXN = 1e6+7;

#define all(x) (x).begin(),(x).end()

/******************************************************/

LL n,m,A,B,C,ans;
LL d[MAXN];
map<LL,LL> mp[MAXN];
vector<PLL> f;
vector<LL> g[MAXN],l[MAXN],r[MAXN], low,high;
char vis[MAXN];

signed main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);//cout<<fixed<<setprecision(9);
    LL i,j,k,mid,u,v,w,res;
    cin>>n>>m>>A>>B>>C;
    for(i=1;i<=m;i++){
        cin>>u>>v;
        mp[u][v]=1;
        mp[v][u]=1;
        g[u].push_back(v);
        g[v].push_back(u);
        d[u]++;d[v]++;
        f.push_back({min(u,v),max(u,v)});
    }
    sort(f.begin(),f.end(),[](PLL a,PLL b){
            return a.first<b.first || (a.first==b.first&&a.second<b.second);
         });
    for(auto x:f){
        l[x.second].push_back(x.first);
        r[x.first].push_back(x.second);
    }

    //0
    res=0;
    for(i=1;i<n-1;i++){
        u=(i+1)*i/2-i;
        v=(n-1)*n/2-u-i;
        res+=A*u*(n-1-i)+B*i*(i)*(n-1-i)+C*v*(i);
        //cout<<i<<" "<<res<<endl;
    }
    ans+=res;
    //cout<<res<<" "<<ans<<endl;

    //1
    res=0;
    for(i=0;i<m;i++){
        PLL x=f[i];
        u=x.first*(x.first+1)/2-x.first;
        res+=A*u+B*x.first*(x.first>=1?x.first:0ull)+C*x.second*(x.first>=1?x.first:0ull);
        //cout<<u<<" "<<res<<" ";
        u=(x.first+x.second)*(x.second-x.first+1)/2-x.first-x.second;
        res+=A*x.first*(x.second-x.first-1)+B*u+C*x.second*(x.second-x.first-1);
        //cout<<u<<" "<<res<<" ";
        u=(n-1+x.second)*(n-1-x.second+1)/2-x.second;
        res+=A*x.first*(n-1-x.second)+B*x.second*(n-1-x.second)+C*u;
        //cout<<i<<" "<<res<<endl;
    }
    ans-=res;
    //cout<<res<<" "<<ans<<endl;

    //2
    res=0;
    LL suml=0,sumr=0,cntl=0,cntr=0,len;
    for(i=0;i<n;i++){
        suml=sumr=cntl=cntr=0;
        sort(all(l[i]));sort(all(r[i]));
        len=l[i].size();
        if(len){
            suml=l[i][0];cntl=1;
            for(j=1;j<len;j++){
                res+=A*suml+B*l[i][j]*cntl+C*i*cntl;
                suml+=l[i][j];
                cntl++;
            }
        }
        len=r[i].size();
        if(len){
            sumr=r[i][0];cntr=1;
            for(j=1;j<len;j++){
                res+=A*i*cntr+B*sumr+C*r[i][j]*cntr;
                sumr+=r[i][j];
                cntr++;
            }
        }
        res+=(A*suml*cntr+B*i*cntl*cntr+C*sumr*cntl)*(cntr>0&&cntl>0);
        //cout<<i<<":"<<res<<endl;
    }
    ans+=res;
    //cout<<res<<" "<<ans<<endl;

    //3
    res=0;
    for(i=1; i<=n; i++){
        if(d[i]<=sqrt(m)) low.push_back(i);
        else high.push_back(i);
    }
    LL lenlow,lenhigh,x,y,z;
    lenlow=low.size();
    for(i=0; i<lenlow; i++){
        x = low[i];
        vis[x] = 1;
        len=g[x].size();
        for(j=0; j<len; j++){
            y = g[x][j];
            if(vis[y]) continue;
            for(k=j+1; k<len; k++){
                z = g[x][k];
                if(vis[z]) continue;
                if(mp[y].count(z)){
                    LL xx,yy,zz;
                    xx=min(min(x,y),z);
                    zz=max(max(x,y),z);
                    yy=x+y+z-xx-zz;
                    res+=A*xx+B*yy+C*zz;
                }
            }
        }
    }
    lenhigh=high.size();
    for(i=0; i<lenhigh; i++){
        for(j=i+1; j<lenhigh; j++){
            x = high[i];
            y = high[j];
            if(mp[x].count(y)==0) continue;
            for(k=j+1; k<lenhigh; k++){
                z = high[k];
                if(mp[y].count(z)&&mp[x].count(z)) {
                    LL xx,yy,zz;
                    xx=min(min(x,y),z);
                    zz=max(max(x,y),z);
                    yy=x+y+z-xx-zz;
                    res+=A*xx+B*yy+C*zz;
                }
            }
        }
    }
    ans-=res;
    //cout<<res<<" "<<ans<<endl;

    cout<<ans<<endl;

    return 0;
}


/*
Author: Snickeen.
Email : ff@snickeen.com

If you find out some bugs, please tell me. Thank you.
*/
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#include<ext/pb_ds/tree_policy.hpp>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/rope>
#include<bits/stdc++.h>
using namespace std;
//using namespace __gnu_cxx;

typedef unsigned long long LL;
typedef double db;
typedef pair<LL,LL> PLL;

const db PI = acos(-1.0);
const db eps = 1e-9;
const LL MOD = 1e9+7;
const LL INF = 1e18+7;
const LL MAXN = 1e6+7;

#define all(x) (x).begin(),(x).end()

/******************************************************/

LL n,m,A,B,C,ans;
LL d[MAXN];
map<LL,LL> mp[MAXN];
vector<PLL> f;
vector<LL> g[MAXN],l[MAXN],r[MAXN], low,high;
char vis[MAXN];

signed main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);//cout<<fixed<<setprecision(9);
    LL i,j,k,mid,u,v,w,res;
    cin>>n>>m>>A>>B>>C;
    for(i=1;i<=m;i++){
        cin>>u>>v;
        mp[u][v]=1;
        mp[v][u]=1;
        g[u].push_back(v);
        g[v].push_back(u);
        d[u]++;d[v]++;
        f.push_back({min(u,v),max(u,v)});
    }
    sort(f.begin(),f.end(),[](PLL a,PLL b){
            return a.first<b.first || (a.first==b.first&&a.second<b.second);
         });
    for(auto x:f){
        l[x.second].push_back(x.first);
        r[x.first].push_back(x.second);
    }

    //0
    res=0;
    for(i=1;i<n-1;i++){
        u=(i+1)*i/2-i;
        v=(n-1)*n/2-u-i;
        res+=A*u*(n-1-i)+B*i*(i)*(n-1-i)+C*v*(i);
    }
    ans+=res;
    //cout<<res<<" "<<ans<<endl;

    //1
    res=0;
    for(i=0;i<m;i++){
        PLL x=f[i];
        u=x.first*(x.first+1)/2-x.first;
        res+=A*u+B*x.first*(x.first-1)+C*x.second*(x.first-1);
        u=(x.first+x.second)*(x.second-x.first+1)/2-x.first-x.second;
        res+=A*x.first*(x.second-x.first-1)+B*u+C*x.second*(x.second-x.first-1);
        u=(n-1+x.second)*(n-1-x.second+1)/2-x.second;
        res+=A*x.first*(n-1-x.second)+B*x.second*(n-1-x.second)+C*u;
    }
    ans-=res;
    //cout<<res<<" "<<ans<<endl;

    //2
    res=0;
    LL suml=0,sumr=0,cntl=0,cntr=0,len;
    for(i=1;i<n-1;i++){
        sort(all(l[i]));sort(all(r[i]));
        len=l[i].size();
        if(len){
            suml=l[i][0];cntl=1;
            for(j=1;j<len;j++){
                res+=A*suml+B*l[i][j]*cntl+C*i*cntl;
                suml+=l[i][j];
                cntl++;
            }
        }
        len=r[i].size();
        if(len){
            sumr=r[i][0];cntr=1;
            for(j=1;j<len;j++){
                res+=A*i*cntr+B*sumr+C*r[i][j]*cntr;
                sumr+=r[i][j];
                cntr++;
            }
        }
        res+=A*suml*cntr+B*i*cntl*cntr+C*sumr*cntl;
    }
    ans+=res;
    //cout<<res<<" "<<ans<<endl;

    //3
    res=0;
    for(i=1; i<=n; i++){
        if(d[i]<=sqrt(m)) low.push_back(i);
        else high.push_back(i);
    }
    LL lenlow,lenhigh,x,y,z;
    lenlow=low.size();
    for(i=0; i<lenlow; i++){
        x = low[i];
        vis[x] = 1;
        len=g[x].size();
        for(j=0; j<len; j++){
            y = g[x][j];
            if(vis[y]) continue;
            for(k=j+1; k<len; k++){
                z = g[x][k];
                if(vis[z]) continue;
                if(mp[y].count(z)){
                    LL xx,yy,zz;
                    xx=min(min(x,y),z);
                    zz=max(max(x,y),z);
                    yy=x+y+z-xx-zz;
                    res+=A*xx+B*yy+C*zz;
                }
            }
        }
    }
    lenhigh=high.size();
    for(i=0; i<lenhigh; i++){
        for(j=i+1; j<lenhigh; j++){
            x = high[i];
            y = high[j];
            if(mp[x].count(y)==0) continue;
            for(k=j+1; k<lenhigh; k++){
                z = high[k];
                if(mp[y].count(z)&&mp[x].count(z)) {
                    LL xx,yy,zz;
                    xx=min(min(x,y),z);
                    zz=max(max(x,y),z);
                    yy=x+y+z-xx-zz;
                    res+=A*xx+B*yy+C*zz;
                }
            }
        }
    }
    ans-=res;
    //cout<<res<<" "<<ans<<endl;

    cout<<ans<<endl;

    return 0;
}


/*
Author: Snickeen.
Email : ff@snickeen.com

If you find out some bugs, please tell me. Thank you.
*/
#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#include<ext/pb_ds/tree_policy.hpp>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/rope>
#include<bits/stdc++.h>
using namespace std;
//using namespace __gnu_cxx;

typedef unsigned long long LL;
typedef double db;
typedef pair<LL,LL> PLL;

const db PI = acos(-1.0);
const db eps = 1e-9;
const LL MOD = 1e9+7;
const LL INF = 1e18+7;
const LL MAXN = 2e5+7;

#define all(x) (x).begin(),(x).end()

/******************************************************/

LL n,m,A,B,C,ans;
LL d[MAXN];
map<LL,LL> mp[MAXN];
vector<PLL> f;
vector<LL> g[MAXN],l[MAXN],r[MAXN], low,high;
char vis[MAXN];

signed main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);//cout<<fixed<<setprecision(9);
    LL i,j,k,mid,u,v,w,res;
    cin>>n>>m>>A>>B>>C;
    for(i=1;i<=m;i++){
        cin>>u>>v;
        mp[u][v]=1;
        mp[v][u]=1;
        g[u].push_back(v);
        g[v].push_back(u);
        d[u]++;d[v]++;
        f.push_back({min(u,v),max(u,v)});
    }
    sort(f.begin(),f.end(),[](PLL a,PLL b){
            return a.first<b.first || (a.first==b.first&&a.second<b.second);
         });
    for(auto x:f){
        l[x.second].push_back(x.first);
        r[x.first].push_back(x.second);
    }

    //0
    res=0;
    for(i=1;i<n-1;i++){
        u=(i+1)*i/2-i;
        v=(n-1)*n/2-u-i;
        res+=A*u*(n-1-i)+B*i*(i)*(n-1-i)+C*v*(i);
        //cout<<i<<" "<<res<<endl;
    }
    ans+=res;
    //cout<<res<<" "<<ans<<endl;

    //1
    res=0;
    for(i=0;i<m;i++){
        PLL x=f[i];
        u=x.first*(x.first+1)/2-x.first;
        res+=A*u+B*x.first*(x.first>=1?x.first:0ull)+C*x.second*(x.first>=1?x.first:0ull);
        //cout<<u<<" "<<res<<" ";
        u=(x.first+x.second)*(x.second-x.first+1)/2-x.first-x.second;
        res+=A*x.first*(x.second-x.first-1)+B*u+C*x.second*(x.second-x.first-1);
        //cout<<u<<" "<<res<<" ";
        u=(n-1+x.second)*(n-1-x.second+1)/2-x.second;
        res+=A*x.first*(n-1-x.second)+B*x.second*(n-1-x.second)+C*u;
        //cout<<i<<" "<<res<<endl;
    }
    ans-=res;
    //cout<<res<<" "<<ans<<endl;

    //2
    res=0;
    LL suml=0,sumr=0,cntl=0,cntr=0,len;
    for(i=0;i<n;i++){
        suml=sumr=cntl=cntr=0;
        //sort(all(l[i]));sort(all(r[i]));
        len=l[i].size();
        if(len){
            suml=l[i][0];cntl=1;
            for(j=1;j<len;j++){
                res+=A*suml+B*l[i][j]*cntl+C*i*cntl;
                suml+=l[i][j];
                cntl++;
            }
        }
        len=r[i].size();
        if(len){
            sumr=r[i][0];cntr=1;
            for(j=1;j<len;j++){
                res+=A*i*cntr+B*sumr+C*r[i][j]*cntr;
                sumr+=r[i][j];
                cntr++;
            }
        }
        res+=(A*suml*cntr+B*i*cntl*cntr+C*sumr*cntl)*(cntr>0&&cntl>0);
        //cout<<i<<":"<<res<<endl;
    }
    ans+=res;
    //cout<<res<<" "<<ans<<endl;

    //3
    res=0;
    for(i=1; i<=n; i++){
        if(d[i]<=sqrt(m)) low.push_back(i);
        else high.push_back(i);
    }
    LL lenlow,lenhigh,x,y,z;
    lenlow=low.size();
    for(i=0; i<lenlow; i++){
        x = low[i];
        vis[x] = 1;
        len=g[x].size();
        for(j=0; j<len; j++){
            y = g[x][j];
            if(vis[y]) continue;
            for(k=j+1; k<len; k++){
                z = g[x][k];
                if(vis[z]) continue;
                if(mp[y][z]){
                    LL xx,yy,zz;
                    xx=min(min(x,y),z);
                    zz=max(max(x,y),z);
                    yy=x+y+z-xx-zz;
                    res+=A*xx+B*yy+C*zz;
                }
            }
        }
    }
    lenhigh=high.size();
    for(i=0; i<lenhigh; i++){

        x = high[i];
        for(j=i+1; j<lenhigh; j++){
            y = high[j];
            if(mp[x][y]==0) continue;
            for(k=j+1; k<lenhigh; k++){
                z = high[k];
                if(mp[y][z]&&mp[x][z]) {
                    LL xx,yy,zz;
                    xx=min(min(x,y),z);
                    zz=max(max(x,y),z);
                    yy=x+y+z-xx-zz;
                    res+=A*xx+B*yy+C*zz;
                }
            }
        }

    }
    ans-=res;
    //cout<<res<<" "<<ans<<endl;

    cout<<ans<<endl;

    return 0;
}


/*
Author: Snickeen.
Email : ff@snickeen.com

If you find out some bugs, please tell me. Thank you.
*/
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#include<ext/pb_ds/tree_policy.hpp>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/rope>
#include<bits/stdc++.h>
using namespace std;
//using namespace __gnu_cxx;

typedef unsigned long long LL;
typedef double db;
typedef pair<LL,LL> PLL;

const db PI = acos(-1.0);
const db eps = 1e-9;
const LL MOD = 1e9+7;
const LL INF = 1e18+7;
const LL MAXN = 1e6+7;

#define all(x) (x).begin(),(x).end()

/******************************************************/

LL n,m,A,B,C,ans;
LL d[MAXN];
map<LL,LL> mp[MAXN];
vector<PLL> f;
vector<LL> g[MAXN],l[MAXN],r[MAXN], low,high;
char vis[MAXN];

signed main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);//cout<<fixed<<setprecision(9);
    LL i,j,k,mid,u,v,w,res;
    cin>>n>>m>>A>>B>>C;
    for(i=1;i<=m;i++){
        cin>>u>>v;
        mp[u][v]=1;
        mp[v][u]=1;
        g[u].push_back(v);
        g[v].push_back(u);
        d[u]++;d[v]++;
        f.push_back({u,v});
    }
    sort(f.begin(),f.end(),[](PLL a,PLL b){
            return a.first<b.first || (a.first==b.first&&a.second<b.second);
         });
    for(auto x:f){
        l[x.second].push_back(x.first);
        r[x.first].push_back(x.second);
    }

    //0
    res=0;
    for(i=1;i<n-1;i++){
        u=(i+1)*i/2-i;
        v=(n-1)*n/2-u-i;
        res+=A*u*(n-1-i)+B*i*(i)*(n-1-i)+C*v*(i);
    }
    ans+=res;

    //1
    res=0;
    for(i=0;i<m;i++){
        PLL x=f[i];
        u=x.first*(x.first+1)/2-x.first;
        res+=A*u+B*x.first*(x.first-1)+C*x.second*(x.first-1);
        u=(x.first+x.second)*(x.second-x.first+1)/2-x.first-x.second;
        res+=A*x.first*(x.second-x.first-1)+B*u+C*x.second*(x.second-x.first-1);
        u=(n-1+x.second)*(n-1-x.second+1)/2-x.second;
        res+=A*x.first*(n-1-x.second)+B*x.second*(n-1-x.second)+C*u;
    }
    ans-=res;

    //2
    res=0;
    LL suml,sumr,cntl,cntr,len;
    for(i=1;i<n-1;i++){
        sort(all(l[i]));sort(all(r[i]));
        len=l[i].size();
        if(len){
            suml=l[i][0];cntl=1;
            for(j=1;j<len;j++){
                res+=A*suml+B*l[i][j]*cntl+C*i*cntl;
                suml+=l[i][j];
                cntl++;
            }
        }
        len=r[i].size();
        if(len){
            sumr=r[i][0];cntr=1;
            for(j=1;j<len;j++){
                res+=A*i*cntr+B*sumr+B*r[i][j]*cntr;
                sumr+=r[i][j];
                cntr++;
            }
        }
        res+=A*suml*cntr+B*i*cntl*cntr+C*sumr*cntl;
    }
    ans+=res;

    //3
    res=0;
    for(i=1; i<=n; i++){
        if(d[i]<=sqrt(m)) low.push_back(i);
        else high.push_back(i);
    }
    LL lenlow,lenhigh,x,y,z;
    lenlow=low.size();
    for(i=0; i<lenlow; i++){
        x = low[i];
        vis[x] = 1;
        len=g[x].size();
        for(j=0; j<len; j++){
            y = g[x][j];
            if(vis[y]) continue;
            for(k=j+1; k<len; k++){
                z = g[x][k];
                if(vis[z]) continue;
                if(mp[y].count(z)){
                    LL xx,yy,zz;
                    xx=min(min(x,y),z);
                    zz=max(max(x,y),z);
                    yy=x+y+z-xx-zz;
                    res+=A*xx+B*yy+C*zz;
                }
            }
        }
    }
    lenhigh=high.size();
    for(i=0; i<lenhigh; i++){
        for(j=i+1; j<lenhigh; j++){
            x = high[i];
            y = high[j];
            if(mp[x].count(y)==0) continue;
            for(k=j+1; k<lenhigh; k++){
                z = high[k];
                if(mp[y].count(z)&&mp[x].count(z)) {
                    LL xx,yy,zz;
                    xx=min(min(x,y),z);
                    zz=max(max(x,y),z);
                    yy=x+y+z-xx-zz;
                    res+=A*xx+B*yy+C*zz;
                }
            }
        }
    }
    ans-=res;

    cout<<ans<<endl;

    return 0;
}


/*
Author: Snickeen.
Email : ff@snickeen.com

If you find out some bugs, please tell me. Thank you.
*/
#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#include<ext/pb_ds/tree_policy.hpp>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/rope>
#include<bits/stdc++.h>
//#include<hash_map>
#include<unordered_set>
using namespace std;
//using namespace __gnu_cxx;

typedef unsigned long long LL;
typedef double db;
typedef pair<LL,LL> PLL;

const db PI = acos(-1.0);
const db eps = 1e-9;
const LL MOD = 1e9+7;
const LL INF = 1e18+7;
const LL MAXN = 2e5+7;

#define all(x) (x).begin(),(x).end()

/******************************************************/

LL n,m,A,B,C,ans;
LL d[MAXN],out[MAXN],link[MAXN],pos[MAXN],vi[MAXN];
map<LL,LL> mp[MAXN];
unordered_set<LL> st;
vector<PLL> f,G[MAXN];
vector<LL> l[MAXN],r[MAXN], g[MAXN],low,high;
char vis[MAXN];

signed main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);//cout<<fixed<<setprecision(9);
    LL i,j,k,mid,u,v,w,res;
    cin>>n>>m>>A>>B>>C;
    for(i=1;i<=m;i++){
        cin>>u>>v;
        //mp[u][v]=1;
        //mp[v][u]=1;
        //g[u].push_back(v);
        //g[v].push_back(u);
        d[u]++;d[v]++;
        f.push_back({min(u,v),max(u,v)});
    }
    sort(f.begin(),f.end(),[](PLL a,PLL b){
            return a.first<b.first || (a.first==b.first&&a.second<b.second);
         });
    for(auto x:f){
        l[x.second].push_back(x.first);
        r[x.first].push_back(x.second);
    }

    //0
    res=0;
    for(i=1;i<n-1;i++){
        u=(i+1)*i/2-i;
        v=(n-1)*n/2-u-i;
        res+=A*u*(n-1-i)+B*i*(i)*(n-1-i)+C*v*(i);
        //cout<<i<<" "<<res<<endl;
    }
    ans+=res;
    //cout<<res<<" "<<ans<<endl;

    //1
    res=0;
    for(i=0;i<m;i++){
        PLL x=f[i];
        u=x.first*(x.first+1)/2-x.first;
        res+=A*u+B*x.first*(x.first>=1?x.first:0ull)+C*x.second*(x.first>=1?x.first:0ull);
        //cout<<u<<" "<<res<<" ";
        u=(x.first+x.second)*(x.second-x.first+1)/2-x.first-x.second;
        res+=A*x.first*(x.second-x.first-1)+B*u+C*x.second*(x.second-x.first-1);
        //cout<<u<<" "<<res<<" ";
        u=(n-1+x.second)*(n-1-x.second+1)/2-x.second;
        res+=A*x.first*(n-1-x.second)+B*x.second*(n-1-x.second)+C*u;
        //cout<<i<<" "<<res<<endl;
    }
    ans-=res;
    //cout<<res<<" "<<ans<<endl;

    //2
    res=0;
    LL suml=0,sumr=0,cntl=0,cntr=0,len;
    for(i=0;i<n;i++){
        suml=sumr=cntl=cntr=0;
        //sort(all(l[i]));sort(all(r[i]));
        len=l[i].size();
        if(len){
            suml=l[i][0];cntl=1;
            for(j=1;j<len;j++){
                res+=A*suml+B*l[i][j]*cntl+C*i*cntl;
                suml+=l[i][j];
                cntl++;
            }
        }
        len=r[i].size();
        if(len){
            sumr=r[i][0];cntr=1;
            for(j=1;j<len;j++){
                res+=A*i*cntr+B*sumr+C*r[i][j]*cntr;
                sumr+=r[i][j];
                cntr++;
            }
        }
        res+=(A*suml*cntr+B*i*cntl*cntr+C*sumr*cntl)*(cntr>0&&cntl>0);
        //cout<<i<<":"<<res<<endl;
    }
    ans+=res;
    //cout<<res<<" "<<ans<<endl;

    //3
    res=0;
    for(auto x:f){
        if(d[x.second]<d[x.first])G[x.second].push_back({x.first,i});
        else G[x.first].push_back({x.second,i});
    }
    for(i=0;i<m;i++){
        u=f[i].first; v=f[i].second;
        for(auto vp:G[u])pos[vp.first]=vp.second, vi[vp.first]=i+1;
        for(auto vp:G[v]){
            w=vp.first;
            if(vi[w]==i+1){
                LL x,y,z;
                x=min(u,min(v,w));
                z=max(u,max(v,w));
                y=u+v+w-x-z;
                res+=A*x+B*y+C*z;
            }
        }
    }
    ans-=res;

    /*
    //WAon5
    res=0;
    for(i=0;i<m;i++){
        u=f[i].first; v=f[i].second;
        if(d[v]<d[u]){
            g[v].push_back(u);out[v]++;mp[v][u]=1;
        }
        else {
            g[u].push_back(v);out[u]++;mp[u][v]=1;
        }
    }
    for(i=0;i<n;i++){
        for(auto x:g[i])link[x]=i+1;
        for(auto x:g[i]){
            if(out[x]>sqrt(m)+1){
                for(auto y:g[i]){
                    if(!mp[x][y])continue;
                    u=min(i,min(x,y));
                    w=max(i,max(x,y));
                    v=i+x+y-u-v;
                    res+=A*u+B*v+C*w;
                }
            }
            else {
                for(auto y:g[x]){
                    if(link[y]!=i+1)continue;
                    u=min(i,min(x,y));
                    w=max(i,max(x,y));
                    v=i+x+y-u-v;
                    res+=A*u+B*v+C*w;
                }
            }
        }
    }
    ans-=res;
    */

    /*
    //TLE
    res=0;
    for(i=1; i<=n; i++){
        if(d[i]<=sqrt(m)) low.push_back(i);
        else high.push_back(i);
    }
    LL lenlow,lenhigh,x,y,z;
    lenlow=low.size();
    for(i=0; i<lenlow; i++){
        x = low[i];
        vis[x] = 1;
        len=g[x].size();
        for(j=0; j<len; j++){
            y = g[x][j];
            if(vis[y]) continue;
            for(k=j+1; k<len; k++){
                z = g[x][k];
                if(vis[z]) continue;
                if(st.find(y*1000000+z)!=st.end()){
                //if(mp[y][z]){
                    LL xx,yy,zz;
                    xx=min(min(x,y),z);
                    zz=max(max(x,y),z);
                    yy=x+y+z-xx-zz;
                    res+=A*xx+B*yy+C*zz;
                }
            }
        }
    }
    lenhigh=high.size();
    for(i=0; i<lenhigh; i++){
        x = high[i];
        for(j=i+1; j<lenhigh; j++){
            y = high[j];
            if(st.find(x*1000000+y)==st.end())continue;
            //if(mp[x][y]==0) continue;
            for(k=j+1; k<lenhigh; k++){
                z = high[k];
                if(st.find(y*1000000+z)!=st.end()&&st.find(x*1000000+z)!=st.end()) {
                //if(mp[y][z]&&mp[x][z]) {
                    LL xx,yy,zz;
                    xx=min(min(x,y),z);
                    zz=max(max(x,y),z);
                    yy=x+y+z-xx-zz;
                    res+=A*xx+B*yy+C*zz;
                }
            }
        }

    }
    ans-=res;
    //cout<<res<<" "<<ans<<endl;
    */

    cout<<ans<<endl;

    return 0;
}


/*
Author: Snickeen.
Email : ff@snickeen.com

If you find out some bugs, please tell me. Thank you.
*/
#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#include<ext/pb_ds/tree_policy.hpp>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/rope>
#include<bits/stdc++.h>
//#include<hash_map>
#include<unordered_set>
using namespace std;
//using namespace __gnu_cxx;

typedef unsigned long long LL;
typedef double db;
typedef pair<LL,LL> PLL;

const db PI = acos(-1.0);
const db eps = 1e-9;
const LL MOD = 1e9+7;
const LL INF = 1e18+7;
const LL MAXN = 2e5+7;

#define all(x) (x).begin(),(x).end()

/******************************************************/

LL n,m,A,B,C,ans;
LL d[MAXN];
map<LL,LL> mp[MAXN];
unordered_set<LL> st;
vector<PLL> f;
vector<LL> g[MAXN],l[MAXN],r[MAXN], low,high;
char vis[MAXN];

signed main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);//cout<<fixed<<setprecision(9);
    LL i,j,k,mid,u,v,w,res;
    cin>>n>>m>>A>>B>>C;
    for(i=1;i<=m;i++){
        cin>>u>>v;
        //mp[u].push_back(v);
        //mp[v].push_back(u);
        st.insert(u*1000000+v);
        st.insert(v*1000000+u);
        //mp[u][v]=1;
        //mp[v][u]=1;
        g[u].push_back(v);
        g[v].push_back(u);
        d[u]++;d[v]++;
        f.push_back({min(u,v),max(u,v)});
    }
    sort(f.begin(),f.end(),[](PLL a,PLL b){
            return a.first<b.first || (a.first==b.first&&a.second<b.second);
         });
    for(auto x:f){
        l[x.second].push_back(x.first);
        r[x.first].push_back(x.second);
    }

    //0
    res=0;
    for(i=1;i<n-1;i++){
        u=(i+1)*i/2-i;
        v=(n-1)*n/2-u-i;
        res+=A*u*(n-1-i)+B*i*(i)*(n-1-i)+C*v*(i);
        //cout<<i<<" "<<res<<endl;
    }
    ans+=res;
    //cout<<res<<" "<<ans<<endl;

    //1
    res=0;
    for(i=0;i<m;i++){
        PLL x=f[i];
        u=x.first*(x.first+1)/2-x.first;
        res+=A*u+B*x.first*(x.first>=1?x.first:0ull)+C*x.second*(x.first>=1?x.first:0ull);
        //cout<<u<<" "<<res<<" ";
        u=(x.first+x.second)*(x.second-x.first+1)/2-x.first-x.second;
        res+=A*x.first*(x.second-x.first-1)+B*u+C*x.second*(x.second-x.first-1);
        //cout<<u<<" "<<res<<" ";
        u=(n-1+x.second)*(n-1-x.second+1)/2-x.second;
        res+=A*x.first*(n-1-x.second)+B*x.second*(n-1-x.second)+C*u;
        //cout<<i<<" "<<res<<endl;
    }
    ans-=res;
    //cout<<res<<" "<<ans<<endl;

    //2
    res=0;
    LL suml=0,sumr=0,cntl=0,cntr=0,len;
    for(i=0;i<n;i++){
        suml=sumr=cntl=cntr=0;
        //sort(all(l[i]));sort(all(r[i]));
        len=l[i].size();
        if(len){
            suml=l[i][0];cntl=1;
            for(j=1;j<len;j++){
                res+=A*suml+B*l[i][j]*cntl+C*i*cntl;
                suml+=l[i][j];
                cntl++;
            }
        }
        len=r[i].size();
        if(len){
            sumr=r[i][0];cntr=1;
            for(j=1;j<len;j++){
                res+=A*i*cntr+B*sumr+C*r[i][j]*cntr;
                sumr+=r[i][j];
                cntr++;
            }
        }
        res+=(A*suml*cntr+B*i*cntl*cntr+C*sumr*cntl)*(cntr>0&&cntl>0);
        //cout<<i<<":"<<res<<endl;
    }
    ans+=res;
    //cout<<res<<" "<<ans<<endl;

    //3
    res=0;
    for(i=1; i<=n; i++){
        if(d[i]<=sqrt(m)) low.push_back(i);
        else high.push_back(i);
    }
    LL lenlow,lenhigh,x,y,z;
    lenlow=low.size();
    for(i=0; i<lenlow; i++){
        x = low[i];
        vis[x] = 1;
        len=g[x].size();
        for(j=0; j<len; j++){
            y = g[x][j];
            if(vis[y]) continue;
            for(k=j+1; k<len; k++){
                z = g[x][k];
                if(vis[z]) continue;
                if(st.find(y*1000000+z)!=st.end()/*mp[y][z]*/){
                    LL xx,yy,zz;
                    xx=min(min(x,y),z);
                    zz=max(max(x,y),z);
                    yy=x+y+z-xx-zz;
                    res+=A*xx+B*yy+C*zz;
                }
            }
        }
    }
    lenhigh=high.size();
    for(i=0; i<lenhigh; i++){

        x = high[i];
        for(j=i+1; j<lenhigh; j++){
            y = high[j];
            if(st.find(x*1000000+y)==st.end())continue;
            //if(mp[x][y]==0) continue;
            for(k=j+1; k<lenhigh; k++){
                z = high[k];
                if(st.find(y*1000000+z)!=st.end()&&st.find(x*1000000+z)!=st.end()/*mp[y][z]&&mp[x][z]*/) {
                    LL xx,yy,zz;
                    xx=min(min(x,y),z);
                    zz=max(max(x,y),z);
                    yy=x+y+z-xx-zz;
                    res+=A*xx+B*yy+C*zz;
                }
            }
        }

    }
    ans-=res;
    //cout<<res<<" "<<ans<<endl;

    cout<<ans<<endl;

    return 0;
}