/*
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];
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][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=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;
    /*
    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;
}


#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long uint;

int n, m;
int a, b, c;
uint an;
vector<int> g[200010];
const int block = 31;
const int maxn = 200000;
bitset<maxn+5> bs[maxn / block + 50];
int change[200010];

inline void upd(int x, int i, int j, int k){
    an += (uint)x * ((uint)i * a + (uint)j * b + (uint)k * c);
}

inline uint getsum(int l, int r){
    if(l > r) return 0;
    return (uint)(l+r) * (r-l+1) / 2;
}

uint stupid(){
    vector<int> g[n];
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            if(i == j) continue;
            bool ok = false;
            for(auto to: (::g[i])) if(to == j) ok = true;
            if(!ok) g[i].push_back(j);
        }
    }
    uint an = 0;
    map<pair<int, pair<int, int>>, char> used;
    for(int i = 0; i < n; i++){
        for(auto to: g[i]){
            for(auto u: g[to]){
                auto it = lower_bound(g[i].begin(), g[i].end(), u);
                if(it != g[i].end() && *it == u)    {
                    int gg[3] = {i, to, u};
                    sort(gg, gg + 3);
                    if(!used[{gg[0], {gg[1], gg[2]}}]){
                        an += (uint)a * gg[0] + (uint)b * gg[1] + (uint)c * gg[2];
                    }
                    used[{gg[0], {gg[1], gg[2]}}] = true;
                }
            }
        }
    }
    return an;
}

main()
{
    ios_base::sync_with_stdio(false);
    cin >> n >> m;
    cin >> a >> b >> c;
    for(int i = 0; i < m; i++){
        int from, to;
        cin >> from >> to;
        g[from].push_back(to);
        g[to].push_back(from);
        uint l = min(from, to), r = max(from, to);
        uint mi = r - l - 1;
        an -= getsum(0, l-1)*a + l*(b*l + c*r);
        an -= getsum(l+1, r-1)*b + ((r-1)-(l+1)+1)*(a*l + c*r);
        an -= getsum(r+1, n-1)*c + ((n-1)-(r+1)+1)*(a*l + b*r);

    }
    for(int i = 0; i < n; i++) sort(g[i].begin(), g[i].end());
    for(int i = 0; i < n; i++){
        uint t = (uint)1 * (n - i - 1) * (n - i - 2) / 2;
        an += (uint)1 * a * i * t;
        t = (uint)1 * (i) * (n - i - 1);
        an += (uint)1 * b * i * t;
        t = (uint)1 * i * (i - 1) / 2;
        an += (uint)1 * c * i * t;
    }
    for(int i = 0; i < n; i++){
        int sum1 = 0, sum2 = 0;
        int cnt1 = 0, cnt2 = 0;
        for(int j: g[i]) if(j < i) sum1 += j, cnt1++; else sum2 += j, cnt2++;
        for(int j: g[i]){
            if(j < i){
                sum1 -= j;
                cnt1--;
                an += (uint)a * j * cnt2 + (uint)b * i * cnt2 + (uint)c * sum2;
                an += (uint)a * j * cnt1 + (uint)b * sum1 + (uint)c * i * cnt1;
            }
            else{
                sum2 -= j;
                cnt2--;
                an += (uint)a * i * cnt2 + (uint)b * j * cnt2 + (uint)c * sum2;
            }
            //if(i == 1) cout << (int)an << endl;
        }
    }
    int lo = 0;
    for(int i = 0; i < n; i++){
        if(g[i].size() > block){
            change[i] = lo++;
            for(auto to: g[i]){
                bs[change[i]][to] = 1;
            }
        }
    }
    for(int i = 0; i < n; i++){
        for(int j: g[i]){
            if(i < j){
                int v1 = i;
                int v2 = j;
                if(g[v1].size() > g[v2].size()) swap(v1, v2);
                for(auto v3: g[v1]){
                    if(j < v3){
                        if(g[v3].size() > block){
                            if(bs[change[v3]][v2] == 1) upd(-1, i, j, v3);
                        }
                        else{
                            if(g[v2].size() > block){
                                if(bs[change[v2]][v3] == 1) upd(-1, i, j, v3);
                            }
                            else{
                                int vv2 = v2, vv3 = v3;
                                if(g[vv2].size() > g[vv3].size()) swap(vv2, vv3);
                                auto it = lower_bound(g[vv2].begin(), g[vv2].end(), vv3);
                                if(it != g[vv2].end() && *it == vv3) upd(-1, i, j, v3);
                            }
                        }
                    }
                }
            }
        }
    }
    cout << an << endl;
    return 0 ;
}


#include <bits/stdc++.h>
using namespace std;
using pint = pair<int, int>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define REP(i, n) FOR(i,0,n)
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
#define dbg(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ") " << __FILE__ << endl;

struct custom_hash
{
    // <https://codeforces.com/blog/entry/62393>
    static uint64_t splitmix64(uint64_t x)
    {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const
    {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using uos = gp_hash_table<int, null_type, custom_hash>; // fast unordered_set

using ull = unsigned long long;

inline ull tousa(ull l, ull r) {
    // l + ... + r - 1
    return ((r - 1) * r - (l - 1) * l) / 2;
}
int main()
{
    ull N;
    int M;
    cin >> N >> M;
    ull A, B, C;
    cin >> A >> B >> C;

    ull ret = 0;
    // zero
    {
        ull n_lo = 0, n_hi = N;
        ull sum_lo = 0, sum_hi = tousa(0, N);
        REP(i, N) {
            n_hi--;
            sum_hi -= i;
            ret += A * sum_lo * n_hi + C * sum_hi * n_lo + B * i * n_lo * n_hi;

            sum_lo += i;
            n_lo++;
        }
    }

    vector<pint> lrs;
    vector<int> deg(N);

    {
        vector<ull> nb_lo(N);
        vector<ull> nb_hi(N);
        vector<ull> sum_lo(N);
        vector<ull> sum_hi(N);

        // one
        while (M--)
        {
            int u, v;
            cin >> u >> v;
            if (u > v) swap(u, v);
            ret -= (A * u + C * v) * (v - u - 1) + B * tousa(u + 1, v);
            ret -= (N - 1 - v) * (A * u + B * v) + C * tousa(v + 1, N);
            ret -= u * (B * u + C * v) + A * tousa(0, u);
            nb_hi[u]++;
            nb_lo[v]++;
            sum_hi[u] += v;
            sum_lo[v] += u;
            lrs.emplace_back(u, v);
            deg[u]++;
            deg[v]++;
        }

        // two
        REP(i, N) ret += nb_lo[i] * sum_hi[i] * C + sum_lo[i] * A * nb_hi[i] + B * i * nb_lo[i] * nb_hi[i];
    }
    {
        sort(lrs.rbegin(), lrs.rend());
        vector<ull> nb_lo(N);
        vector<ull> sum_lo(N);
        for (auto lr : lrs) {
            int l = lr.first, r = lr.second;
            ret += sum_lo[r] * B + nb_lo[r] * (l * A + r * C);
            nb_lo[r]++;
            sum_lo[r] += l;
        }
    }
    {
        sort(lrs.begin(), lrs.end(), [](pint l, pint r) { if (l.second != r.second) return l.second < r.second; else return l.first < r.first; });
        vector<ull> nb_hi(N);
        vector<ull> sum_hi(N);
        for (auto lr : lrs) {
            int l = lr.first, r = lr.second;
            ret += sum_hi[l] * B + nb_hi[l] * (l * A + r * C);
            nb_hi[l]++;
            sum_hi[l] += r;
        }
    }

    int TD = 4000;
    vector<int> dense_vertex(N, -1);
    vector<int> dl;
    REP(i, N) if (deg[i] >= TD) {
        dense_vertex[i] = dl.size();
        dl.push_back(i);
    }
    int ND = dl.size();
    vector<vector<int>> edense(ND, vector<int>(ND));
    vector<unordered_set<int, custom_hash>> adj(N);
    vector<vector<int>> adj_dense(N);
    for (auto p : lrs) {
        int u = dense_vertex[p.first];
        int v = dense_vertex[p.second];
        if (u >= 0 and v >= 0) edense[u][v] = 1;
        else {
            int s = p.first, t = p.second;
            if (adj[s].size() > adj[t].size()) swap(s, t);
            for (auto r : adj[s]) {
                if (adj[t].find(r) != adj[t].end()) {
                    if (r < p.first) ret -= r * A + p.first * B + p.second * C;
                    else if (p.second < r) ret -= p.first * A + p.second * B + r * C;
                    else ret -= p.first * A + r * B + p.second * C;
                }
            }
            adj[p.first].insert(p.second);
            adj[p.second].insert(p.first);
        }

        if (u >= 0) adj_dense[p.second].push_back(u);
        if (v >= 0) adj_dense[p.first].push_back(v);
    }

    REP(k, ND) REP(j, k) REP(i, j) if (edense[i][j] and edense[j][k] and edense[i][k]) {
        ret -= A * dl[i] + B * dl[j] + C * dl[k];
    }

    REP(r, N) {
        sort(adj_dense[r].begin(), adj_dense[r].end());
        REP(j, adj_dense[r].size()) REP(i, j) {
            int s = adj_dense[r][i];
            int t = adj_dense[r][j];
            if (adj_dense[s][t]) {
                int u = dl[s];
                int v = dl[t];
                if (r < u) ret -= A * r + B * u + C * v;
                else if (v < r) ret -= A * u + B * v + C * r;
                else ret -= A * u + B * r + C * v;
            }
        }
    }
    cout << ret << "\n";
}


#include <bits/stdc++.h>
using namespace std;
using pint = pair<int, int>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define REP(i, n) FOR(i,0,n)
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
#define dbg(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ") " << __FILE__ << endl;

struct custom_hash
{
    // <https://codeforces.com/blog/entry/62393>
    static uint64_t splitmix64(uint64_t x)
    {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const
    {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using uos = gp_hash_table<int, null_type, custom_hash>; // fast unordered_set

using ull = unsigned long long;

inline ull tousa(ull l, ull r) {
    // l + ... + r - 1
    return ((r - 1) * r - (l - 1) * l) / 2;
}
int main()
{
    ull N;
    int M;
    cin >> N >> M;
    ull A, B, C;
    cin >> A >> B >> C;

    ull ret = 0;
    // zero
    {
        ull n_lo = 0, n_hi = N;
        ull sum_lo = 0, sum_hi = tousa(0, N);
        REP(i, N) {
            n_hi--;
            sum_hi -= i;
            ret += A * sum_lo * n_hi + C * sum_hi * n_lo + B * i * n_lo * n_hi;

            sum_lo += i;
            n_lo++;
        }
    }

    vector<pint> lrs;
    vector<int> deg(N);

    {
        vector<ull> nb_lo(N);
        vector<ull> nb_hi(N);
        vector<ull> sum_lo(N);
        vector<ull> sum_hi(N);

        // one
        while (M--)
        {
            int u, v;
            cin >> u >> v;
            if (u > v) swap(u, v);
            ret -= (A * u + C * v) * (v - u - 1) + B * tousa(u + 1, v);
            ret -= (N - 1 - v) * (A * u + B * v) + C * tousa(v + 1, N);
            ret -= u * (B * u + C * v) + A * tousa(0, u);
            nb_hi[u]++;
            nb_lo[v]++;
            sum_hi[u] += v;
            sum_lo[v] += u;
            lrs.emplace_back(u, v);
            deg[u]++;
            deg[v]++;
        }

        // two
        REP(i, N) ret += nb_lo[i] * sum_hi[i] * C + sum_lo[i] * A * nb_hi[i] + B * i * nb_lo[i] * nb_hi[i];
    }
    {
        sort(lrs.rbegin(), lrs.rend());
        vector<ull> nb_lo(N);
        vector<ull> sum_lo(N);
        for (auto lr : lrs) {
            int l = lr.first, r = lr.second;
            ret += sum_lo[r] * B + nb_lo[r] * (l * A + r * C);
            nb_lo[r]++;
            sum_lo[r] += l;
        }
    }
    {
        sort(lrs.begin(), lrs.end(), [](pint l, pint r) { if (l.second != r.second) return l.second < r.second; else return l.first < r.first; });
        vector<ull> nb_hi(N);
        vector<ull> sum_hi(N);
        for (auto lr : lrs) {
            int l = lr.first, r = lr.second;
            ret += sum_hi[l] * B + nb_hi[l] * (l * A + r * C);
            nb_hi[l]++;
            sum_hi[l] += r;
        }
    }

    int TD = 4000;
    vector<int> dense_vertex(N, -1);
    vector<int> dl;
    REP(i, N) if (deg[i] >= TD) {
        dense_vertex[i] = dl.size();
        dl.push_back(i);
    }
    int ND = dl.size();
    vector<vector<int>> edense(ND, vector<int>(ND));
    vector<uos> adj(N);
    vector<vector<int>> adj_dense(N);
    for (auto p : lrs) {
        int u = dense_vertex[p.first];
        int v = dense_vertex[p.second];
        if (u >= 0 and v >= 0) edense[u][v] = 1;
        else {
            int s = p.first, t = p.second;
            if (adj[s].size() > adj[t].size()) swap(s, t);
            for (auto r : adj[s]) {
                if (adj[t].find(r) != adj[t].end()) {
                    if (r < p.first) ret -= r * A + p.first * B + p.second * C;
                    else if (p.second < r) ret -= p.first * A + p.second * B + r * C;
                    else ret -= p.first * A + r * B + p.second * C;
                }
            }
            adj[p.first].insert(p.second);
            adj[p.second].insert(p.first);
        }

        if (u >= 0) adj_dense[p.second].push_back(u);
        if (v >= 0) adj_dense[p.first].push_back(v);
    }

    REP(k, ND) REP(j, k) REP(i, j) if (edense[i][j] and edense[j][k] and edense[i][k]) {
        ret -= A * dl[i] + B * dl[j] + C * dl[k];
    }

    REP(r, N) {
        sort(adj_dense[r].begin(), adj_dense[r].end());
        REP(j, adj_dense[r].size()) REP(i, j) {
            int s = adj_dense[r][i];
            int t = adj_dense[r][j];
            if (adj_dense[s][t]) {
                int u = dl[s];
                int v = dl[t];
                if (r < u) ret -= A * r + B * u + C * v;
                else if (v < r) ret -= A * u + B * v + C * r;
                else ret -= A * u + B * r + C * v;
            }
        }
    }
    cout << ret << "\n";
}


#include <bits/stdc++.h>
using namespace std;
using pint = pair<int, int>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define REP(i, n) FOR(i,0,n)
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
#define dbg(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ") " << __FILE__ << endl;

struct custom_hash
{
    // <https://codeforces.com/blog/entry/62393>
    static uint64_t splitmix64(uint64_t x)
    {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const
    {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using uos = gp_hash_table<int, null_type, custom_hash>; // fast unordered_set

using ull = unsigned long long;

inline ull tousa(ull l, ull r) {
    // l + ... + r - 1
    return ((r - 1) * r - (l - 1) * l) / 2;
}
int main()
{
    ull N;
    int M;
    cin >> N >> M;
    ull A, B, C;
    cin >> A >> B >> C;

    ull ret = 0;
    // zero
    {
        ull n_lo = 0, n_hi = N;
        ull sum_lo = 0, sum_hi = tousa(0, N);
        REP(i, N) {
            n_hi--;
            sum_hi -= i;
            ret += A * sum_lo * n_hi + C * sum_hi * n_lo + B * i * n_lo * n_hi;

            sum_lo += i;
            n_lo++;
        }
    }

    vector<pint> lrs;
    vector<int> deg(N);

    {
        vector<ull> nb_lo(N);
        vector<ull> nb_hi(N);
        vector<ull> sum_lo(N);
        vector<ull> sum_hi(N);

        // one
        while (M--)
        {
            int u, v;
            cin >> u >> v;
            if (u > v) swap(u, v);
            ret -= (A * u + C * v) * (v - u - 1) + B * tousa(u + 1, v);
            ret -= (N - 1 - v) * (A * u + B * v) + C * tousa(v + 1, N);
            ret -= u * (B * u + C * v) + A * tousa(0, u);
            nb_hi[u]++;
            nb_lo[v]++;
            sum_hi[u] += v;
            sum_lo[v] += u;
            lrs.emplace_back(u, v);
            deg[u]++;
            deg[v]++;
        }

        // two
        REP(i, N) ret += nb_lo[i] * sum_hi[i] * C + sum_lo[i] * A * nb_hi[i] + B * i * nb_lo[i] * nb_hi[i];
    }
    {
        sort(lrs.rbegin(), lrs.rend());
        vector<ull> nb_lo(N);
        vector<ull> sum_lo(N);
        for (auto lr : lrs) {
            int l = lr.first, r = lr.second;
            ret += sum_lo[r] * B + nb_lo[r] * (l * A + r * C);
            nb_lo[r]++;
            sum_lo[r] += l;
        }
    }
    {
        sort(lrs.begin(), lrs.end(), [](pint l, pint r) { if (l.second != r.second) return l.second < r.second; else return l.first < r.first; });
        vector<ull> nb_hi(N);
        vector<ull> sum_hi(N);
        for (auto lr : lrs) {
            int l = lr.first, r = lr.second;
            ret += sum_hi[l] * B + nb_hi[l] * (l * A + r * C);
            nb_hi[l]++;
            sum_hi[l] += r;
        }
    }

    int TD = 2000;
    vector<int> dense_vertex(N, -1);
    vector<int> dl;
    REP(i, N) if (deg[i] >= TD) {
        dense_vertex[i] = dl.size();
        dl.push_back(i);
    }
    int ND = dl.size();
    vector<vector<int>> edense(ND, vector<int>(ND));
    vector<uos> adj(N);
    vector<vector<int>> adj_dense(N);
    for (auto p : lrs) {
        int u = dense_vertex[p.first];
        int v = dense_vertex[p.second];
        if (u >= 0 and v >= 0) edense[u][v] = 1;
        else {
            for (auto r : adj[p.first]) {
                if (adj[p.second].find(r) != adj[p.second].end()) {
                    if (r < p.first) ret -= r * A + p.first * B + p.second * C;
                    else if (p.second < r) ret -= p.first * A + p.second * B + r * C;
                    else ret -= p.first * A + r * B + p.second * C;
                }
            }
            adj[p.first].insert(p.second);
            adj[p.second].insert(p.first);
        }

        if (u >= 0) adj_dense[p.second].push_back(u);
        if (v >= 0) adj_dense[p.first].push_back(v);
    }

    REP(k, ND) REP(j, k) REP(i, j) if (edense[i][j] and edense[j][k] and edense[i][k]) {
        ret -= A * dl[i] + B * dl[j] + C * dl[k];
    }

    REP(r, N) {
        sort(adj_dense[r].begin(), adj_dense[r].end());
        REP(j, adj_dense[r].size()) REP(i, j) {
            int s = adj_dense[r][i];
            int t = adj_dense[r][j];
            if (adj_dense[s][t]) {
                int u = dl[s];
                int v = dl[t];
                if (r < u) ret -= A * r + B * u + C * v;
                else if (v < r) ret -= A * u + B * v + C * r;
                else ret -= A * u + B * r + C * v;
            }
        }
    }
    cout << ret << "\n";
}


#include <bits/stdc++.h>
using namespace std;
using pint = pair<int, int>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define REP(i, n) FOR(i,0,n)
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
#define dbg(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ") " << __FILE__ << endl;

struct custom_hash
{
    // <https://codeforces.com/blog/entry/62393>
    static uint64_t splitmix64(uint64_t x)
    {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const
    {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using uos = gp_hash_table<int, null_type, custom_hash>; // fast unordered_set

using ull = unsigned long long;

inline ull tousa(ull l, ull r) {
    // l + ... + r - 1
    return ((r - 1) * r - (l - 1) * l) / 2;
}
int main()
{
    ull N;
    int M;
    cin >> N >> M;
    ull A, B, C;
    cin >> A >> B >> C;

    ull ret = 0;
    // zero
    {
        ull n_lo = 0, n_hi = N;
        ull sum_lo = 0, sum_hi = tousa(0, N);
        REP(i, N) {
            n_hi--;
            sum_hi -= i;
            ret += A * sum_lo * n_hi + C * sum_hi * n_lo + B * i * n_lo * n_hi;

            sum_lo += i;
            n_lo++;
        }
    }

    vector<pint> lrs;
    vector<int> deg(N);

    {
        vector<ull> nb_lo(N);
        vector<ull> nb_hi(N);
        vector<ull> sum_lo(N);
        vector<ull> sum_hi(N);

        // one
        while (M--)
        {
            int u, v;
            cin >> u >> v;
            if (u > v) swap(u, v);
            ret -= (A * u + C * v) * (v - u - 1) + B * tousa(u + 1, v);
            ret -= (N - 1 - v) * (A * u + B * v) + C * tousa(v + 1, N);
            ret -= u * (B * u + C * v) + A * tousa(0, u);
            nb_hi[u]++;
            nb_lo[v]++;
            sum_hi[u] += v;
            sum_lo[v] += u;
            lrs.emplace_back(u, v);
            deg[u]++;
            deg[v]++;
        }

        // two
        REP(i, N) ret += nb_lo[i] * sum_hi[i] * C + sum_lo[i] * A * nb_hi[i] + B * i * nb_lo[i] * nb_hi[i];
    }
    {
        sort(lrs.rbegin(), lrs.rend());
        vector<ull> nb_lo(N);
        vector<ull> sum_lo(N);
        for (auto lr : lrs) {
            int l = lr.first, r = lr.second;
            ret += sum_lo[r] * B + nb_lo[r] * (l * A + r * C);
            nb_lo[r]++;
            sum_lo[r] += l;
        }
    }
    {
        sort(lrs.begin(), lrs.end(), [](pint l, pint r) { if (l.second != r.second) return l.second < r.second; else return l.first < r.first; });
        vector<ull> nb_hi(N);
        vector<ull> sum_hi(N);
        for (auto lr : lrs) {
            int l = lr.first, r = lr.second;
            ret += sum_hi[l] * B + nb_hi[l] * (l * A + r * C);
            nb_hi[l]++;
            sum_hi[l] += r;
        }
    }

    int TD = 4000;
    vector<int> dense_vertex(N, -1);
    vector<int> dl;
    REP(i, N) if (deg[i] >= TD) {
        dense_vertex[i] = dl.size();
        dl.push_back(i);
    }
    int ND = dl.size();
    vector<vector<int>> edense(ND, vector<int>(ND));
    vector<unordered_set<int>> adj(N);
    vector<vector<int>> adj_dense(N);
    for (auto p : lrs) {
        int u = dense_vertex[p.first];
        int v = dense_vertex[p.second];
        if (u >= 0 and v >= 0) edense[u][v] = 1;
        else {
            int s = p.first, t = p.second;
            if (adj[s].size() > adj[t].size()) swap(s, t);
            for (auto r : adj[s]) {
                if (adj[t].find(r) != adj[t].end()) {
                    if (r < p.first) ret -= r * A + p.first * B + p.second * C;
                    else if (p.second < r) ret -= p.first * A + p.second * B + r * C;
                    else ret -= p.first * A + r * B + p.second * C;
                }
            }
            adj[p.first].insert(p.second);
            adj[p.second].insert(p.first);
        }

        if (u >= 0) adj_dense[p.second].push_back(u);
        if (v >= 0) adj_dense[p.first].push_back(v);
    }

    REP(k, ND) REP(j, k) REP(i, j) if (edense[i][j] and edense[j][k] and edense[i][k]) {
        ret -= A * dl[i] + B * dl[j] + C * dl[k];
    }

    REP(r, N) {
        sort(adj_dense[r].begin(), adj_dense[r].end());
        REP(j, adj_dense[r].size()) REP(i, j) {
            int s = adj_dense[r][i];
            int t = adj_dense[r][j];
            if (adj_dense[s][t]) {
                int u = dl[s];
                int v = dl[t];
                if (r < u) ret -= A * r + B * u + C * v;
                else if (v < r) ret -= A * u + B * v + C * r;
                else ret -= A * u + B * r + C * v;
            }
        }
    }
    cout << ret << "\n";
}


#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
template<typename T> void ndarray(vector<T> &vec, int len) { vec.resize(len); }
template<typename T, typename... Args> void ndarray(vector<T> &vec, int len, Args... args) { vec.resize(len); for (auto &v : vec) ndarray(v, args...); }
template<typename T> bool chmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool chmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }
template<typename T1, typename T2> pair<T1, T2> operator+(const pair<T1, T2> &l, const pair<T1, T2> &r) { return make_pair(l.first + r.first, l.second + r.second); }
template<typename T1, typename T2> pair<T1, T2> operator-(const pair<T1, T2> &l, const pair<T1, T2> &r) { return make_pair(l.first - r.first, l.second - r.second); }
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const deque<T> &vec){ os << "deq["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const unordered_map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
#define dbg(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ") " << __FILE__ << endl;
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/tag_and_trait.hpp>
using namespace __gnu_pbds; // find_by_order(), order_of_key()
template<typename TK> using pbds_set = tree<TK, null_type, less<TK>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename TK, typename TV> using pbds_map = tree<TK, TV, less<TK>, rb_tree_tag, tree_order_statistics_node_update>;
*/

using ull = unsigned long long;

inline ull tousa(ull l, ull r) {
    // l + ... + r - 1
    return ((r - 1) * r - (l - 1) * l) / 2;
}
int main()
{
    ull N;
    int M;
    cin >> N >> M;
    ull A, B, C;
    cin >> A >> B >> C;

    ull ret = 0;

    // zero
    {
        ull n_lo = 0, n_hi = N;
        ull sum_lo = 0, sum_hi = tousa(0, N);
        REP(i, N) {
            n_hi--;
            sum_hi -= i;
            ret += A * sum_lo * n_hi + C * sum_hi * n_lo + B * i * n_lo * n_hi;

            sum_lo += i;
            n_lo++;
        }
    }

    dbg(ret);

    vector<pint> lrs;
    vector<int> deg(N);

    {
        vector<ull> nb_lo(N);
        vector<ull> nb_hi(N);
        vector<ull> sum_lo(N);
        vector<ull> sum_hi(N);

        // one
        while (M--)
        {
            int u, v;
            cin >> u >> v;
            if (u > v) swap(u, v);
            ret -= (A * u + C * v) * (v - u - 1) + B * tousa(u + 1, v);
            ret -= (N - 1 - v) * (A * u + B * v) + C * tousa(v + 1, N);
            ret -= u * (B * u + C * v) + A * tousa(0, u);
            nb_hi[u]++;
            nb_lo[v]++;
            sum_hi[u] += v;
            sum_lo[v] += u;
            lrs.emplace_back(u, v);
            deg[u]++;
            deg[v]++;
        }

        dbg(ret);

        // two
        REP(i, N) ret += nb_lo[i] * sum_hi[i] * C + sum_lo[i] * A * nb_hi[i] + B * i * nb_lo[i] * nb_hi[i];
    }
    {
        sort(lrs.rbegin(), lrs.rend());
        vector<ull> nb_lo(N);
        vector<ull> sum_lo(N);
        for (auto lr : lrs) {
            int l = lr.first, r = lr.second;
            ret += sum_lo[r] * B + nb_lo[r] * (l * A + r * C);
            nb_lo[r]++;
            sum_lo[r] += l;
        }
    }
    {
        sort(lrs.begin(), lrs.end(), [](pint l, pint r) { if (l.second != r.second) return l.second < r.second; else return l.first < r.first; });
        vector<ull> nb_hi(N);
        vector<ull> sum_hi(N);
        for (auto lr : lrs) {
            int l = lr.first, r = lr.second;
            ret += sum_hi[l] * B + nb_hi[l] * (l * A + r * C);
            nb_hi[l]++;
            sum_hi[l] += r;
        }
    }

    dbg(ret);

    int TD = 1000;
    vector<int> dense_vertex(N, -1);
    vector<int> dl;
    REP(i, N) if (deg[i] >= TD) {
        dense_vertex[i] = dl.size();
        dl.push_back(i);
    }
    int ND = dl.size();
    vector<vector<int>> edense(ND, vector<int>(ND));
    vector<set<int>> adj(N);
    vector<vector<int>> adj_dense(N);
    for (auto p : lrs) {
        int u = dense_vertex[p.first];
        int v = dense_vertex[p.second];
        if (u >= 0 and v >= 0) edense[u][v] = 1;
        else {
            for (auto r : adj[p.first]) {
                if (adj[p.second].count(r)) {
                    if (r < p.first) ret -= r * A + p.first * B + p.second * C;
                    else if (p.second < r) ret -= p.first * A + p.second * B + r * C;
                    else ret -= p.first * A + r * B + p.second * C;
                }
            }
            adj[p.first].insert(p.second);
            adj[p.second].insert(p.first);
        }

        if (u >= 0) adj_dense[p.second].push_back(u);
        if (v >= 0) adj_dense[p.first].push_back(v);
    }

    REP(k, ND) REP(j, k) REP(i, j) if (edense[i][j] and edense[j][k] and edense[i][k]) {
        ret -= A * dl[i] + B * dl[j] + C * dl[k];
    }

    REP(r, N) {
        sort(adj_dense[r].begin(), adj_dense[r].end());
        REP(j, adj_dense[r].size()) REP(i, j) {
            int s = adj_dense[r][i];
            int t = adj_dense[r][j];
            if (adj_dense[s][t]) {
                int u = dl[s];
                int v = dl[t];
                if (r < u) ret -= A * r + B * u + C * v;
                else if (v < r) ret -= A * u + B * v + C * r;
                else ret -= A * u + B * r + C * v;
            }
        }
    }
    dbg(ret);
    cout << ret << "\n";
}


#include <bits/stdc++.h>
using namespace std;
using pint = pair<int, int>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define REP(i, n) FOR(i,0,n)
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
#define dbg(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ") " << __FILE__ << endl;

struct custom_hash
{
    // <https://codeforces.com/blog/entry/62393>
    static uint64_t splitmix64(uint64_t x)
    {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const
    {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using uos = gp_hash_table<int, null_type, custom_hash>; // fast unordered_set

using ull = unsigned long long;

inline ull tousa(ull l, ull r) {
    // l + ... + r - 1
    return ((r - 1) * r - (l - 1) * l) / 2;
}
int main()
{
    ull N;
    int M;
    cin >> N >> M;
    ull A, B, C;
    cin >> A >> B >> C;

    ull ret = 0;
    // zero
    {
        ull n_lo = 0, n_hi = N;
        ull sum_lo = 0, sum_hi = tousa(0, N);
        REP(i, N) {
            n_hi--;
            sum_hi -= i;
            ret += A * sum_lo * n_hi + C * sum_hi * n_lo + B * i * n_lo * n_hi;

            sum_lo += i;
            n_lo++;
        }
    }

    vector<pint> lrs;
    vector<int> deg(N);

    {
        vector<ull> nb_lo(N);
        vector<ull> nb_hi(N);
        vector<ull> sum_lo(N);
        vector<ull> sum_hi(N);

        // one
        while (M--)
        {
            int u, v;
            cin >> u >> v;
            if (u > v) swap(u, v);
            ret -= (A * u + C * v) * (v - u - 1) + B * tousa(u + 1, v);
            ret -= (N - 1 - v) * (A * u + B * v) + C * tousa(v + 1, N);
            ret -= u * (B * u + C * v) + A * tousa(0, u);
            nb_hi[u]++;
            nb_lo[v]++;
            sum_hi[u] += v;
            sum_lo[v] += u;
            lrs.emplace_back(u, v);
            deg[u]++;
            deg[v]++;
        }

        // two
        REP(i, N) ret += nb_lo[i] * sum_hi[i] * C + sum_lo[i] * A * nb_hi[i] + B * i * nb_lo[i] * nb_hi[i];
    }
    {
        sort(lrs.rbegin(), lrs.rend());
        vector<ull> nb_lo(N);
        vector<ull> sum_lo(N);
        for (auto lr : lrs) {
            int l = lr.first, r = lr.second;
            ret += sum_lo[r] * B + nb_lo[r] * (l * A + r * C);
            nb_lo[r]++;
            sum_lo[r] += l;
        }
    }
    {
        sort(lrs.begin(), lrs.end(), [](pint l, pint r) { if (l.second != r.second) return l.second < r.second; else return l.first < r.first; });
        vector<ull> nb_hi(N);
        vector<ull> sum_hi(N);
        for (auto lr : lrs) {
            int l = lr.first, r = lr.second;
            ret += sum_hi[l] * B + nb_hi[l] * (l * A + r * C);
            nb_hi[l]++;
            sum_hi[l] += r;
        }
    }

    int TD = 4000;
    vector<int> dense_vertex(N, -1);
    vector<int> dl;
    REP(i, N) if (deg[i] >= TD) {
        dense_vertex[i] = dl.size();
        dl.push_back(i);
    }
    int ND = dl.size();
    vector<vector<int>> edense(ND, vector<int>(ND));
    vector<unordered_set<int, custom_hash>> adj(N);
    vector<vector<int>> adj_dense(N);
    for (auto p : lrs) {
        int u = dense_vertex[p.first];
        int v = dense_vertex[p.second];
        if (u >= 0 and v >= 0) edense[u][v] = 1;
        else {
            for (auto r : adj[p.first]) {
                if (adj[p.second].find(r) != adj[p.second].end()) {
                    if (r < p.first) ret -= r * A + p.first * B + p.second * C;
                    else if (p.second < r) ret -= p.first * A + p.second * B + r * C;
                    else ret -= p.first * A + r * B + p.second * C;
                }
            }
            adj[p.first].insert(p.second);
            adj[p.second].insert(p.first);
        }

        if (u >= 0) adj_dense[p.second].push_back(u);
        if (v >= 0) adj_dense[p.first].push_back(v);
    }

    REP(k, ND) REP(j, k) REP(i, j) if (edense[i][j] and edense[j][k] and edense[i][k]) {
        ret -= A * dl[i] + B * dl[j] + C * dl[k];
    }

    REP(r, N) {
        sort(adj_dense[r].begin(), adj_dense[r].end());
        REP(j, adj_dense[r].size()) REP(i, j) {
            int s = adj_dense[r][i];
            int t = adj_dense[r][j];
            if (adj_dense[s][t]) {
                int u = dl[s];
                int v = dl[t];
                if (r < u) ret -= A * r + B * u + C * v;
                else if (v < r) ret -= A * u + B * v + C * r;
                else ret -= A * u + B * r + C * v;
            }
        }
    }
    cout << ret << "\n";
}


#include <bits/stdc++.h>
using namespace std;
using pint = pair<int, int>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define REP(i, n) FOR(i,0,n)
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
#define dbg(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ") " << __FILE__ << endl;

struct custom_hash
{
    // <https://codeforces.com/blog/entry/62393>
    static uint64_t splitmix64(uint64_t x)
    {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const
    {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using uos = gp_hash_table<int, null_type, custom_hash>; // fast unordered_set

using ull = unsigned long long;

inline ull tousa(ull l, ull r) {
    // l + ... + r - 1
    return ((r - 1) * r - (l - 1) * l) / 2;
}
int main()
{
    ull N;
    int M;
    cin >> N >> M;
    ull A, B, C;
    cin >> A >> B >> C;

    ull ret = 0;
    // zero
    {
        ull n_lo = 0, n_hi = N;
        ull sum_lo = 0, sum_hi = tousa(0, N);
        REP(i, N) {
            n_hi--;
            sum_hi -= i;
            ret += A * sum_lo * n_hi + C * sum_hi * n_lo + B * i * n_lo * n_hi;

            sum_lo += i;
            n_lo++;
        }
    }

    vector<pint> lrs;
    vector<int> deg(N);

    {
        vector<ull> nb_lo(N);
        vector<ull> nb_hi(N);
        vector<ull> sum_lo(N);
        vector<ull> sum_hi(N);

        // one
        while (M--)
        {
            int u, v;
            cin >> u >> v;
            if (u > v) swap(u, v);
            ret -= (A * u + C * v) * (v - u - 1) + B * tousa(u + 1, v);
            ret -= (N - 1 - v) * (A * u + B * v) + C * tousa(v + 1, N);
            ret -= u * (B * u + C * v) + A * tousa(0, u);
            nb_hi[u]++;
            nb_lo[v]++;
            sum_hi[u] += v;
            sum_lo[v] += u;
            lrs.emplace_back(u, v);
            deg[u]++;
            deg[v]++;
        }

        // two
        REP(i, N) ret += nb_lo[i] * sum_hi[i] * C + sum_lo[i] * A * nb_hi[i] + B * i * nb_lo[i] * nb_hi[i];
    }
    {
        sort(lrs.rbegin(), lrs.rend());
        vector<ull> nb_lo(N);
        vector<ull> sum_lo(N);
        for (auto lr : lrs) {
            int l = lr.first, r = lr.second;
            ret += sum_lo[r] * B + nb_lo[r] * (l * A + r * C);
            nb_lo[r]++;
            sum_lo[r] += l;
        }
    }
    {
        sort(lrs.begin(), lrs.end(), [](pint l, pint r) { if (l.second != r.second) return l.second < r.second; else return l.first < r.first; });
        vector<ull> nb_hi(N);
        vector<ull> sum_hi(N);
        for (auto lr : lrs) {
            int l = lr.first, r = lr.second;
            ret += sum_hi[l] * B + nb_hi[l] * (l * A + r * C);
            nb_hi[l]++;
            sum_hi[l] += r;
        }
    }

    int TD = 1000;
    vector<int> dense_vertex(N, -1);
    vector<int> dl;
    REP(i, N) if (deg[i] >= TD) {
        dense_vertex[i] = dl.size();
        dl.push_back(i);
    }
    int ND = dl.size();
    vector<vector<int>> edense(ND, vector<int>(ND));
    vector<unordered_set<int, custom_hash>> adj(N);
    vector<vector<int>> adj_dense(N);
    for (auto p : lrs) {
        int u = dense_vertex[p.first];
        int v = dense_vertex[p.second];
        if (u >= 0 and v >= 0) edense[u][v] = 1;
        else {
            for (auto r : adj[p.first]) {
                if (adj[p.second].find(r) != adj[p.second].end()) {
                    if (r < p.first) ret -= r * A + p.first * B + p.second * C;
                    else if (p.second < r) ret -= p.first * A + p.second * B + r * C;
                    else ret -= p.first * A + r * B + p.second * C;
                }
            }
            adj[p.first].insert(p.second);
            adj[p.second].insert(p.first);
        }

        if (u >= 0) adj_dense[p.second].push_back(u);
        if (v >= 0) adj_dense[p.first].push_back(v);
    }

    REP(k, ND) REP(j, k) REP(i, j) if (edense[i][j] and edense[j][k] and edense[i][k]) {
        ret -= A * dl[i] + B * dl[j] + C * dl[k];
    }

    REP(r, N) {
        sort(adj_dense[r].begin(), adj_dense[r].end());
        REP(j, adj_dense[r].size()) REP(i, j) {
            int s = adj_dense[r][i];
            int t = adj_dense[r][j];
            if (adj_dense[s][t]) {
                int u = dl[s];
                int v = dl[t];
                if (r < u) ret -= A * r + B * u + C * v;
                else if (v < r) ret -= A * u + B * v + C * r;
                else ret -= A * u + B * r + C * v;
            }
        }
    }
    cout << ret << "\n";
}


#include <bits/stdc++.h>
using namespace std;
using pint = pair<int, int>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define REP(i, n) FOR(i,0,n)
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
#define dbg(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ") " << __FILE__ << endl;

struct custom_hash
{
    // <https://codeforces.com/blog/entry/62393>
    static uint64_t splitmix64(uint64_t x)
    {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const
    {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using uos = gp_hash_table<int, null_type, custom_hash>; // fast unordered_set

using ull = unsigned long long;

inline ull tousa(ull l, ull r) {
    // l + ... + r - 1
    return ((r - 1) * r - (l - 1) * l) / 2;
}
int main()
{
    ull N;
    int M;
    cin >> N >> M;
    ull A, B, C;
    cin >> A >> B >> C;

    ull ret = 0;
    // zero
    {
        ull n_lo = 0, n_hi = N;
        ull sum_lo = 0, sum_hi = tousa(0, N);
        REP(i, N) {
            n_hi--;
            sum_hi -= i;
            ret += A * sum_lo * n_hi + C * sum_hi * n_lo + B * i * n_lo * n_hi;

            sum_lo += i;
            n_lo++;
        }
    }

    vector<pint> lrs;
    vector<int> deg(N);

    {
        vector<ull> nb_lo(N);
        vector<ull> nb_hi(N);
        vector<ull> sum_lo(N);
        vector<ull> sum_hi(N);

        // one
        while (M--)
        {
            int u, v;
            cin >> u >> v;
            if (u > v) swap(u, v);
            ret -= (A * u + C * v) * (v - u - 1) + B * tousa(u + 1, v);
            ret -= (N - 1 - v) * (A * u + B * v) + C * tousa(v + 1, N);
            ret -= u * (B * u + C * v) + A * tousa(0, u);
            nb_hi[u]++;
            nb_lo[v]++;
            sum_hi[u] += v;
            sum_lo[v] += u;
            lrs.emplace_back(u, v);
            deg[u]++;
            deg[v]++;
        }

        // two
        REP(i, N) ret += nb_lo[i] * sum_hi[i] * C + sum_lo[i] * A * nb_hi[i] + B * i * nb_lo[i] * nb_hi[i];
    }
    {
        sort(lrs.rbegin(), lrs.rend());
        vector<ull> nb_lo(N);
        vector<ull> sum_lo(N);
        for (auto lr : lrs) {
            int l = lr.first, r = lr.second;
            ret += sum_lo[r] * B + nb_lo[r] * (l * A + r * C);
            nb_lo[r]++;
            sum_lo[r] += l;
        }
    }
    {
        sort(lrs.begin(), lrs.end(), [](pint l, pint r) { if (l.second != r.second) return l.second < r.second; else return l.first < r.first; });
        vector<ull> nb_hi(N);
        vector<ull> sum_hi(N);
        for (auto lr : lrs) {
            int l = lr.first, r = lr.second;
            ret += sum_hi[l] * B + nb_hi[l] * (l * A + r * C);
            nb_hi[l]++;
            sum_hi[l] += r;
        }
    }

    int TD = 1000;
    vector<int> dense_vertex(N, -1);
    vector<int> dl;
    REP(i, N) if (deg[i] >= TD) {
        dense_vertex[i] = dl.size();
        dl.push_back(i);
    }
    int ND = dl.size();
    vector<vector<int>> edense(ND, vector<int>(ND));
    vector<uos> adj(N);
    vector<vector<int>> adj_dense(N);
    for (auto p : lrs) {
        int u = dense_vertex[p.first];
        int v = dense_vertex[p.second];
        if (u >= 0 and v >= 0) edense[u][v] = 1;
        else {
            for (auto r : adj[p.first]) {
                if (adj[p.second].find(r) != adj[p.second].end()) {
                    if (r < p.first) ret -= r * A + p.first * B + p.second * C;
                    else if (p.second < r) ret -= p.first * A + p.second * B + r * C;
                    else ret -= p.first * A + r * B + p.second * C;
                }
            }
            adj[p.first].insert(p.second);
            adj[p.second].insert(p.first);
        }

        if (u >= 0) adj_dense[p.second].push_back(u);
        if (v >= 0) adj_dense[p.first].push_back(v);
    }

    REP(k, ND) REP(j, k) REP(i, j) if (edense[i][j] and edense[j][k] and edense[i][k]) {
        ret -= A * dl[i] + B * dl[j] + C * dl[k];
    }

    REP(r, N) {
        sort(adj_dense[r].begin(), adj_dense[r].end());
        REP(j, adj_dense[r].size()) REP(i, j) {
            int s = adj_dense[r][i];
            int t = adj_dense[r][j];
            if (adj_dense[s][t]) {
                int u = dl[s];
                int v = dl[t];
                if (r < u) ret -= A * r + B * u + C * v;
                else if (v < r) ret -= A * u + B * v + C * r;
                else ret -= A * u + B * r + C * v;
            }
        }
    }
    cout << ret << "\n";
}


#include <bits/stdc++.h>
using namespace std;
using pint = pair<int, int>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define REP(i, n) FOR(i,0,n)
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
#define dbg(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ") " << __FILE__ << endl;

struct custom_hash
{
    // <https://codeforces.com/blog/entry/62393>
    static uint64_t splitmix64(uint64_t x)
    {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const
    {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using uos = gp_hash_table<int, null_type, custom_hash>; // fast unordered_set

using ull = unsigned long long;

inline ull tousa(ull l, ull r) {
    // l + ... + r - 1
    return ((r - 1) * r - (l - 1) * l) / 2;
}
int main()
{
    ull N;
    int M;
    cin >> N >> M;
    ull A, B, C;
    cin >> A >> B >> C;

    ull ret = 0;
    // zero
    {
        ull n_lo = 0, n_hi = N;
        ull sum_lo = 0, sum_hi = tousa(0, N);
        REP(i, N) {
            n_hi--;
            sum_hi -= i;
            ret += A * sum_lo * n_hi + C * sum_hi * n_lo + B * i * n_lo * n_hi;

            sum_lo += i;
            n_lo++;
        }
    }

    vector<pint> lrs;
    vector<int> deg(N);

    {
        vector<ull> nb_lo(N);
        vector<ull> nb_hi(N);
        vector<ull> sum_lo(N);
        vector<ull> sum_hi(N);

        // one
        while (M--)
        {
            int u, v;
            cin >> u >> v;
            if (u > v) swap(u, v);
            ret -= (A * u + C * v) * (v - u - 1) + B * tousa(u + 1, v);
            ret -= (N - 1 - v) * (A * u + B * v) + C * tousa(v + 1, N);
            ret -= u * (B * u + C * v) + A * tousa(0, u);
            nb_hi[u]++;
            nb_lo[v]++;
            sum_hi[u] += v;
            sum_lo[v] += u;
            lrs.emplace_back(u, v);
            deg[u]++;
            deg[v]++;
        }

        // two
        REP(i, N) ret += nb_lo[i] * sum_hi[i] * C + sum_lo[i] * A * nb_hi[i] + B * i * nb_lo[i] * nb_hi[i];
    }
    {
        sort(lrs.rbegin(), lrs.rend());
        vector<ull> nb_lo(N);
        vector<ull> sum_lo(N);
        for (auto lr : lrs) {
            int l = lr.first, r = lr.second;
            ret += sum_lo[r] * B + nb_lo[r] * (l * A + r * C);
            nb_lo[r]++;
            sum_lo[r] += l;
        }
    }
    {
        sort(lrs.begin(), lrs.end(), [](pint l, pint r) { if (l.second != r.second) return l.second < r.second; else return l.first < r.first; });
        vector<ull> nb_hi(N);
        vector<ull> sum_hi(N);
        for (auto lr : lrs) {
            int l = lr.first, r = lr.second;
            ret += sum_hi[l] * B + nb_hi[l] * (l * A + r * C);
            nb_hi[l]++;
            sum_hi[l] += r;
        }
    }

    int TD = 4000;
    vector<int> dense_vertex(N, -1);
    vector<int> dl;
    REP(i, N) if (deg[i] >= TD) {
        dense_vertex[i] = dl.size();
        dl.push_back(i);
    }
    int ND = dl.size();
    vector<vector<int>> edense(ND, vector<int>(ND));
    vector<uos> adj(N);
    vector<vector<int>> adj_dense(N);
    for (auto p : lrs) {
        int u = dense_vertex[p.first];
        int v = dense_vertex[p.second];
        if (u >= 0 and v >= 0) edense[u][v] = 1;
        else {
            for (auto r : adj[p.first]) {
                if (adj[p.second].find(r) != adj[p.second].end()) {
                    if (r < p.first) ret -= r * A + p.first * B + p.second * C;
                    else if (p.second < r) ret -= p.first * A + p.second * B + r * C;
                    else ret -= p.first * A + r * B + p.second * C;
                }
            }
            adj[p.first].insert(p.second);
            adj[p.second].insert(p.first);
        }

        if (u >= 0) adj_dense[p.second].push_back(u);
        if (v >= 0) adj_dense[p.first].push_back(v);
    }

    REP(k, ND) REP(j, k) REP(i, j) if (edense[i][j] and edense[j][k] and edense[i][k]) {
        ret -= A * dl[i] + B * dl[j] + C * dl[k];
    }

    REP(r, N) {
        sort(adj_dense[r].begin(), adj_dense[r].end());
        REP(j, adj_dense[r].size()) REP(i, j) {
            int s = adj_dense[r][i];
            int t = adj_dense[r][j];
            if (adj_dense[s][t]) {
                int u = dl[s];
                int v = dl[t];
                if (r < u) ret -= A * r + B * u + C * v;
                else if (v < r) ret -= A * u + B * v + C * r;
                else ret -= A * u + B * r + C * v;
            }
        }
    }
    cout << ret << "\n";
}


#include <bits/stdc++.h>
using namespace std;
using pint = pair<int, int>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define REP(i, n) FOR(i,0,n)
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
#define dbg(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ") " << __FILE__ << endl;

struct custom_hash
{
    // <https://codeforces.com/blog/entry/62393>
    static uint64_t splitmix64(uint64_t x)
    {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const
    {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using uos = gp_hash_table<int, null_type, custom_hash>; // fast unordered_set

using ull = unsigned long long;

inline ull tousa(ull l, ull r) {
    // l + ... + r - 1
    return ((r - 1) * r - (l - 1) * l) / 2;
}
int main()
{
    ull N;
    int M;
    cin >> N >> M;
    ull A, B, C;
    cin >> A >> B >> C;

    ull ret = 0;
    // zero
    {
        ull n_lo = 0, n_hi = N;
        ull sum_lo = 0, sum_hi = tousa(0, N);
        REP(i, N) {
            n_hi--;
            sum_hi -= i;
            ret += A * sum_lo * n_hi + C * sum_hi * n_lo + B * i * n_lo * n_hi;

            sum_lo += i;
            n_lo++;
        }
    }

    vector<pint> lrs;
    vector<int> deg(N);

    {
        vector<ull> nb_lo(N);
        vector<ull> nb_hi(N);
        vector<ull> sum_lo(N);
        vector<ull> sum_hi(N);

        // one
        while (M--)
        {
            int u, v;
            cin >> u >> v;
            if (u > v) swap(u, v);
            ret -= (A * u + C * v) * (v - u - 1) + B * tousa(u + 1, v);
            ret -= (N - 1 - v) * (A * u + B * v) + C * tousa(v + 1, N);
            ret -= u * (B * u + C * v) + A * tousa(0, u);
            nb_hi[u]++;
            nb_lo[v]++;
            sum_hi[u] += v;
            sum_lo[v] += u;
            lrs.emplace_back(u, v);
            deg[u]++;
            deg[v]++;
        }

        // two
        REP(i, N) ret += nb_lo[i] * sum_hi[i] * C + sum_lo[i] * A * nb_hi[i] + B * i * nb_lo[i] * nb_hi[i];
    }
    {
        sort(lrs.rbegin(), lrs.rend());
        vector<ull> nb_lo(N);
        vector<ull> sum_lo(N);
        for (auto lr : lrs) {
            int l = lr.first, r = lr.second;
            ret += sum_lo[r] * B + nb_lo[r] * (l * A + r * C);
            nb_lo[r]++;
            sum_lo[r] += l;
        }
    }
    {
        sort(lrs.begin(), lrs.end(), [](pint l, pint r) { if (l.second != r.second) return l.second < r.second; else return l.first < r.first; });
        vector<ull> nb_hi(N);
        vector<ull> sum_hi(N);
        for (auto lr : lrs) {
            int l = lr.first, r = lr.second;
            ret += sum_hi[l] * B + nb_hi[l] * (l * A + r * C);
            nb_hi[l]++;
            sum_hi[l] += r;
        }
    }

    int TD = 4000;
    vector<int> dense_vertex(N, -1);
    vector<int> dl;
    REP(i, N) if (deg[i] >= TD) {
        dense_vertex[i] = dl.size();
        dl.push_back(i);
    }
    int ND = dl.size();
    vector<vector<int>> edense(ND, vector<int>(ND));
    vector<unordered_set<int, custom_hash>> adj(N);
    vector<vector<int>> adj_dense(N);
    for (auto p : lrs) {
        int u = dense_vertex[p.first];
        int v = dense_vertex[p.second];
        if (u >= 0 and v >= 0) edense[u][v] = 1;
        else {
            int s = p.first, t = p.second;
            if (u >= 0) swap(s, t);
            for (auto r : adj[s]) {
                if (adj[t].find(r) != adj[t].end()) {
                    if (r < p.first) ret -= r * A + p.first * B + p.second * C;
                    else if (p.second < r) ret -= p.first * A + p.second * B + r * C;
                    else ret -= p.first * A + r * B + p.second * C;
                }
            }
            adj[p.first].insert(p.second);
            adj[p.second].insert(p.first);
        }

        if (u >= 0) adj_dense[p.second].push_back(u);
        if (v >= 0) adj_dense[p.first].push_back(v);
    }

    REP(k, ND) REP(j, k) REP(i, j) if (edense[i][j] and edense[j][k] and edense[i][k]) {
        ret -= A * dl[i] + B * dl[j] + C * dl[k];
    }

    REP(r, N) {
        sort(adj_dense[r].begin(), adj_dense[r].end());
        REP(j, adj_dense[r].size()) REP(i, j) {
            int s = adj_dense[r][i];
            int t = adj_dense[r][j];
            if (adj_dense[s][t]) {
                int u = dl[s];
                int v = dl[t];
                if (r < u) ret -= A * r + B * u + C * v;
                else if (v < r) ret -= A * u + B * v + C * r;
                else ret -= A * u + B * r + C * v;
            }
        }
    }
    cout << ret << "\n";
}


#include <bits/stdc++.h>
using namespace std;
using pint = pair<int, int>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define REP(i, n) FOR(i,0,n)
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
#define dbg(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ") " << __FILE__ << endl;

struct custom_hash
{
    // <https://codeforces.com/blog/entry/62393>
    static uint64_t splitmix64(uint64_t x)
    {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const
    {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using uos = gp_hash_table<int, null_type, custom_hash>; // fast unordered_set

using ull = unsigned long long;

inline ull tousa(ull l, ull r) {
    // l + ... + r - 1
    return ((r - 1) * r - (l - 1) * l) / 2;
}
int main()
{
    ull N;
    int M;
    cin >> N >> M;
    ull A, B, C;
    cin >> A >> B >> C;

    ull ret = 0;
    // zero
    {
        ull n_lo = 0, n_hi = N;
        ull sum_lo = 0, sum_hi = tousa(0, N);
        REP(i, N) {
            n_hi--;
            sum_hi -= i;
            ret += A * sum_lo * n_hi + C * sum_hi * n_lo + B * i * n_lo * n_hi;

            sum_lo += i;
            n_lo++;
        }
    }

    vector<pint> lrs;
    vector<int> deg(N);

    {
        vector<ull> nb_lo(N);
        vector<ull> nb_hi(N);
        vector<ull> sum_lo(N);
        vector<ull> sum_hi(N);

        // one
        while (M--)
        {
            int u, v;
            cin >> u >> v;
            if (u > v) swap(u, v);
            ret -= (A * u + C * v) * (v - u - 1) + B * tousa(u + 1, v);
            ret -= (N - 1 - v) * (A * u + B * v) + C * tousa(v + 1, N);
            ret -= u * (B * u + C * v) + A * tousa(0, u);
            nb_hi[u]++;
            nb_lo[v]++;
            sum_hi[u] += v;
            sum_lo[v] += u;
            lrs.emplace_back(u, v);
            deg[u]++;
            deg[v]++;
        }

        // two
        REP(i, N) ret += nb_lo[i] * sum_hi[i] * C + sum_lo[i] * A * nb_hi[i] + B * i * nb_lo[i] * nb_hi[i];
    }
    {
        sort(lrs.rbegin(), lrs.rend());
        vector<ull> nb_lo(N);
        vector<ull> sum_lo(N);
        for (auto lr : lrs) {
            int l = lr.first, r = lr.second;
            ret += sum_lo[r] * B + nb_lo[r] * (l * A + r * C);
            nb_lo[r]++;
            sum_lo[r] += l;
        }
    }
    {
        sort(lrs.begin(), lrs.end(), [](pint l, pint r) { if (l.second != r.second) return l.second < r.second; else return l.first < r.first; });
        vector<ull> nb_hi(N);
        vector<ull> sum_hi(N);
        for (auto lr : lrs) {
            int l = lr.first, r = lr.second;
            ret += sum_hi[l] * B + nb_hi[l] * (l * A + r * C);
            nb_hi[l]++;
            sum_hi[l] += r;
        }
    }

    int TD = 4000;
    vector<int> dense_vertex(N, -1);
    vector<int> dl;
    REP(i, N) if (deg[i] >= TD) {
        dense_vertex[i] = dl.size();
        dl.push_back(i);
    }
    int ND = dl.size();
    vector<vector<int>> edense(ND, vector<int>(ND));
    vector<uos> adj(N);
    vector<vector<int>> adj_dense(N);
    for (auto p : lrs) {
        int u = dense_vertex[p.first];
        int v = dense_vertex[p.second];
        if (u >= 0 and v >= 0) edense[u][v] = 1;
        else {
            int s = p.first, t = p.second;
            if (u >= 0) swap(s, t);
            for (auto r : adj[s]) {
                if (adj[t].find(r) != adj[t].end()) {
                    if (r < p.first) ret -= r * A + p.first * B + p.second * C;
                    else if (p.second < r) ret -= p.first * A + p.second * B + r * C;
                    else ret -= p.first * A + r * B + p.second * C;
                }
            }
            adj[p.first].insert(p.second);
            adj[p.second].insert(p.first);
        }

        if (u >= 0) adj_dense[p.second].push_back(u);
        if (v >= 0) adj_dense[p.first].push_back(v);
    }

    REP(k, ND) REP(j, k) REP(i, j) if (edense[i][j] and edense[j][k] and edense[i][k]) {
        ret -= A * dl[i] + B * dl[j] + C * dl[k];
    }

    REP(r, N) {
        sort(adj_dense[r].begin(), adj_dense[r].end());
        REP(j, adj_dense[r].size()) REP(i, j) {
            int s = adj_dense[r][i];
            int t = adj_dense[r][j];
            if (adj_dense[s][t]) {
                int u = dl[s];
                int v = dl[t];
                if (r < u) ret -= A * r + B * u + C * v;
                else if (v < r) ret -= A * u + B * v + C * r;
                else ret -= A * u + B * r + C * v;
            }
        }
    }
    cout << ret << "\n";
}


#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long uint;

int n, m;
int a, b, c;
uint an;
vector<int> g[200010];
const int block = 31;
const int maxn = 200000;
bitset<maxn> bs[maxn / block + 50];
int change[200010];

inline void upd(int x, int i, int j, int k){
    //cout << x << ' ' << i << ' ' << j << ' ' << k << endl;
    an += (uint)x * ((uint)i * a + (uint)j * b + (uint)k * c);
}

inline uint getsum(int l, int r){
    if(l > r) return 0;
    return (uint)(l+r) * (r-l+1) / 2;
}

uint stupid(){
    vector<int> g[20];
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            if(i == j) continue;
            bool ok = false;
            for(auto to: (::g[i])) if(to == j) ok = true;
            if(!ok) g[i].push_back(j);
        }
    }
    uint an = 0;
    char used[10000] = {};
    for(int i = 0; i < n; i++){
        for(auto to: g[i]){
            for(auto u: g[to]){
                auto it = lower_bound(g[i].begin(), g[i].end(), u);
                if(it != g[i].end() && *it == u){
                    int gg[3] = {i, to, u};
                    sort(gg, gg + 3);
                    if(!used[gg[0] * 100 + gg[1] * 10 + gg[2]]){
                        an += (uint)a * gg[0] + (uint)b * gg[1] + (uint)c * gg[2];
                    }
                    used[gg[0] * 100 + gg[1] * 10 + gg[2]] = true;
                }
            }
        }
    }
    return an;
}

main()
{
    ios_base::sync_with_stdio(false);
    cin >> n >> m;
    cin >> a >> b >> c;
    for(int i = 0; i < m; i++){
        int from, to;
        cin >> from >> to;
        g[from].push_back(to);
        g[to].push_back(from);
        int l = min(from, to), r = max(from, to);
        int mi = r - l - 1;
        an -= getsum(0, l-1)*a + l*(b*l + c*r);
        //cout << from << ' ' << to << ' ' << (int)an << endl;
        an -= getsum(l+1, r-1)*b + ((r-1)-(l+1)+1)*(a*l + c*r);
        //cout << from << ' ' << to << ' ' << (int)an << endl;
        an -= getsum(r+1, n-1)*c + ((n-1)-(r+1)+1)*(a*l + b*r);
        //cout << from << ' ' << to << ' ' << (int)an << endl;
        //cout << endl;
    }
    for(int i = 0; i < n; i++) sort(g[i].begin(), g[i].end());
    for(int i = 0; i < n; i++){
        int t = (uint)1 * (n - i - 1) * (n - i - 2) / 2;
        an += (uint)1 * a * i * t;
        t = (uint)1 * (i) * (n - i - 1);
        an += (uint)1 * b * i * t;
        t = (uint)1 * i * (i - 1) / 2;
        an += (uint)1 * c * i * t;
    }
    //cout << (int)an << endl;
    for(int i = 0; i < n; i++){
        int sum1 = 0, sum2 = 0;
        int cnt1 = 0, cnt2 = 0;
        for(int j: g[i]) if(j < i) sum1 += j, cnt1++; else sum2 += j, cnt2++;
        for(int j: g[i]){
            if(j < i){
                sum1 -= j;
                cnt1--;
                an += (uint)a * j * cnt2 + (uint)b * i * cnt2 + (uint)c * sum2;
                an += (uint)a * j * cnt1 + (uint)b * sum1 + (uint)c * i * cnt1;
            }
            else{
                sum2 -= j;
                cnt2--;
                an += (uint)a * i * cnt2 + (uint)b * j * cnt2 + (uint)c * sum2;
            }
            //if(i == 1) cout << (int)an << endl;
        }
    }
    /*for(int i = 0; i < n; i++){
        for(int j: g[i]){
            for(int k: g[i]){
                if(j < k){
                    int g[3] = {i, j, k};
                    sort(g, g + 3);
                    cout << "/ "; upd(1, g[0], g[1], g[2]);
                }
            }
        }
    }*/
    int lo = 0;
    for(int i = 0; i < n; i++){
        if(g[i].size() > block){
            change[i] = lo++;
            for(auto to: g[i]){
                bs[change[i]][to] = 1;
            }
        }
    }
    for(int i = 0; i < n; i++){
        for(int j: g[i]){
            if(i < j){
                int v1 = i;
                int v2 = j;
                if(g[v1].size() > g[v2].size()) swap(v1, v2);
                for(auto v3: g[v1]){
                    if(j < v3){
                        if(g[v3].size() > block){
                            if(bs[change[v3]][v2] == 1) upd(-1, i, j, v3);
                        }
                        else{
                            if(g[v2].size() > block){
                                if(bs[change[v2]][v3] == 1) upd(-1, i, j, v3);
                            }
                            else{
                                int vv2 = v2, vv3 = v3;
                                if(g[vv2].size() > g[vv3].size()) swap(vv2, vv3);
                                auto it = lower_bound(g[vv2].begin(), g[vv2].end(), vv3);
                                if(it != g[vv2].end() && *it == vv3) upd(-1, i, j, v3);
                            }
                        }
                    }
                }
            }
        }
    }
    cout << (uint)an << endl;
    //cout << stupid() << endl;
}


#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long uint;

int n, m;
int a, b, c;
uint an;
vector<int> g[200010];
const int block = 31;
const int maxn = 200000;
bitset<maxn+5> bs[maxn / block + 50];
int change[200010];

inline void upd(int x, int i, int j, int k){
    //cout << x << ' ' << i << ' ' << j << ' ' << k << endl;
    an += (uint)x * ((uint)i * a + (uint)j * b + (uint)k * c);
}

inline uint getsum(int l, int r){
    if(l > r) return 0;
    return (uint)(l+r) * (r-l+1) / 2;
}

uint stupid(){
    vector<int> g[n];
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            if(i == j) continue;
            bool ok = false;
            for(auto to: (::g[i])) if(to == j) ok = true;
            if(!ok) g[i].push_back(j);
        }
    }
    uint an = 0;
    map<pair<int, pair<int, int>>, char> used;
    for(int i = 0; i < n; i++){
        for(auto to: g[i]){
            for(auto u: g[to]){
                auto it = lower_bound(g[i].begin(), g[i].end(), u);
                if(it != g[i].end() && *it == u)    {
                    int gg[3] = {i, to, u};
                    sort(gg, gg + 3);
                    if(!used[{gg[0], {gg[1], gg[2]}}]){
                        an += (uint)a * gg[0] + (uint)b * gg[1] + (uint)c * gg[2];
                    }
                    used[{gg[0], {gg[1], gg[2]}}] = true;
                }
            }
        }
    }
    return an;
}

main()
{
    ios_base::sync_with_stdio(false);
    cin >> n >> m;
    cin >> a >> b >> c;
    for(int i = 0; i < m; i++){
        int from, to;
        cin >> from >> to;
//    for(int from = 0; from < n; from++) for(int to = from + 1; to < n; to++){
//        if(rand() & 1) continue;
        g[from].push_back(to);
        g[to].push_back(from);
        uint l = min(from, to), r = max(from, to);
        uint mi = r - l - 1;
        an -= getsum(0, l-1)*a + l*(b*l + c*r);
        //cout << from << ' ' << to << ' ' << (int)an << endl;
        an -= getsum(l+1, r-1)*b + ((r-1)-(l+1)+1)*(a*l + c*r);
        //cout << from << ' ' << to << ' ' << (int)an << endl;
        an -= getsum(r+1, n-1)*c + ((n-1)-(r+1)+1)*(a*l + b*r);
        //cout << from << ' ' << to << ' ' << (int)an << endl;
        //cout << endl;
    }
    for(int i = 0; i < n; i++) sort(g[i].begin(), g[i].end());
    for(int i = 0; i < n; i++){
        uint t = (uint)1 * (n - i - 1) * (n - i - 2) / 2;
        an += (uint)1 * a * i * t;
        t = (uint)1 * (i) * (n - i - 1);
        an += (uint)1 * b * i * t;
        t = (uint)1 * i * (i - 1) / 2;
        an += (uint)1 * c * i * t;
    }
    //cout << (int)an << endl;
    for(int i = 0; i < n; i++){
        int sum1 = 0, sum2 = 0;
        int cnt1 = 0, cnt2 = 0;
        for(int j: g[i]) if(j < i) sum1 += j, cnt1++; else sum2 += j, cnt2++;
        for(int j: g[i]){
            if(j < i){
                sum1 -= j;
                cnt1--;
                an += (uint)a * j * cnt2 + (uint)b * i * cnt2 + (uint)c * sum2;
                an += (uint)a * j * cnt1 + (uint)b * sum1 + (uint)c * i * cnt1;
            }
            else{
                sum2 -= j;
                cnt2--;
                an += (uint)a * i * cnt2 + (uint)b * j * cnt2 + (uint)c * sum2;
            }
            //if(i == 1) cout << (int)an << endl;
        }
    }
//    for(int i = 0; i < n; i++){
//        for(int j: g[i]){
//            for(int k: g[i]){
//                if(j < k){
//                    int g[3] = {i, j, k};
//                    sort(g, g + 3);
//                    cout << "/ "; upd(1, g[0], g[1], g[2]);
//                }
//            }
//        }
//    }
    int lo = 0;
    for(int i = 0; i < n; i++){
        if(g[i].size() > block){
            change[i] = lo++;
            for(auto to: g[i]){
                bs[change[i]][to] = 1;
            }
        }
    }
    for(int i = 0; i < n; i++){
        for(int j: g[i]){
            if(i < j){
                int v1 = i;
                int v2 = j;
                if(g[v1].size() > g[v2].size()) swap(v1, v2);
                for(auto v3: g[v1]){
                    if(j < v3){
                        if(g[v3].size() > block){
                            if(bs[change[v3]][v2] == 1) upd(-1, i, j, v3);
                        }
                        else{
                            if(g[v2].size() > block){
                                if(bs[change[v2]][v3] == 1) upd(-1, i, j, v3);
                            }
                            else{
                                int vv2 = v2, vv3 = v3;
                                if(g[vv2].size() > g[vv3].size()) swap(vv2, vv3);
                                auto it = lower_bound(g[vv2].begin(), g[vv2].end(), vv3);
                                if(it != g[vv2].end() && *it == vv3) upd(-1, i, j, v3);
                            }
                        }
                    }
                }
            }
        }
    }
    cout << an << endl;
    //cout << stupid() << endl;
}


#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long uint;

int n, m;
int a, b, c;
uint an;
vector<int> g[200010];
const int block = 31;
const int maxn = 200000;
bitset<maxn+5> bs[maxn / block + 50];
int change[200010];

inline void upd(int x, int i, int j, int k){
    //cout << x << ' ' << i << ' ' << j << ' ' << k << endl;
    an += (uint)x * ((uint)i * a + (uint)j * b + (uint)k * c);
}

inline uint getsum(int l, int r){
    if(l > r) return 0;
    return (uint)(l+r) * (r-l+1) / 2;
}

uint stupid(){
    vector<int> g[n];
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            if(i == j) continue;
            bool ok = false;
            for(auto to: (::g[i])) if(to == j) ok = true;
            if(!ok) g[i].push_back(j);
        }
    }
    uint an = 0;
    map<pair<int, pair<int, int>>, char> used;
    for(int i = 0; i < n; i++){
        for(auto to: g[i]){
            for(auto u: g[to]){
                auto it = lower_bound(g[i].begin(), g[i].end(), u);
                if(it != g[i].end() && *it == u)    {
                    int gg[3] = {i, to, u};
                    sort(gg, gg + 3);
                    if(!used[{gg[0], {gg[1], gg[2]}}]){
                        an += (uint)a * gg[0] + (uint)b * gg[1] + (uint)c * gg[2];
                    }
                    used[{gg[0], {gg[1], gg[2]}}] = true;
                }
            }
        }
    }
    return an;
}

main()
{
    ios_base::sync_with_stdio(false);
    cin >> n >> m;
    cin >> a >> b >> c;
    for(int i = 0; i < m; i++){
        int from, to;
        cin >> from >> to;
//    for(int from = 0; from < n; from++) for(int to = from + 1; to < n; to++){
//        if(rand() & 1) continue;
        g[from].push_back(to);
        g[to].push_back(from);
        int l = min(from, to), r = max(from, to);
        int mi = r - l - 1;
        an -= getsum(0, l-1)*a + l*(b*l + c*r);
        //cout << from << ' ' << to << ' ' << (int)an << endl;
        an -= getsum(l+1, r-1)*b + ((r-1)-(l+1)+1)*(a*l + c*r);
        //cout << from << ' ' << to << ' ' << (int)an << endl;
        an -= getsum(r+1, n-1)*c + ((n-1)-(r+1)+1)*(a*l + b*r);
        //cout << from << ' ' << to << ' ' << (int)an << endl;
        //cout << endl;
    }
    for(int i = 0; i < n; i++) sort(g[i].begin(), g[i].end());
    for(int i = 0; i < n; i++){
        uint t = (uint)1 * (n - i - 1) * (n - i - 2) / 2;
        an += (uint)1 * a * i * t;
        t = (uint)1 * (i) * (n - i - 1);
        an += (uint)1 * b * i * t;
        t = (uint)1 * i * (i - 1) / 2;
        an += (uint)1 * c * i * t;
    }
    //cout << (int)an << endl;
    for(int i = 0; i < n; i++){
        int sum1 = 0, sum2 = 0;
        int cnt1 = 0, cnt2 = 0;
        for(int j: g[i]) if(j < i) sum1 += j, cnt1++; else sum2 += j, cnt2++;
        for(int j: g[i]){
            if(j < i){
                sum1 -= j;
                cnt1--;
                an += (uint)a * j * cnt2 + (uint)b * i * cnt2 + (uint)c * sum2;
                an += (uint)a * j * cnt1 + (uint)b * sum1 + (uint)c * i * cnt1;
            }
            else{
                sum2 -= j;
                cnt2--;
                an += (uint)a * i * cnt2 + (uint)b * j * cnt2 + (uint)c * sum2;
            }
            //if(i == 1) cout << (int)an << endl;
        }
    }
//    for(int i = 0; i < n; i++){
//        for(int j: g[i]){
//            for(int k: g[i]){
//                if(j < k){
//                    int g[3] = {i, j, k};
//                    sort(g, g + 3);
//                    cout << "/ "; upd(1, g[0], g[1], g[2]);
//                }
//            }
//        }
//    }
    int lo = 0;
    for(int i = 0; i < n; i++){
        if(g[i].size() > block){
            change[i] = lo++;
            for(auto to: g[i]){
                bs[change[i]][to] = 1;
            }
        }
    }
    for(int i = 0; i < n; i++){
        for(int j: g[i]){
            if(i < j){
                int v1 = i;
                int v2 = j;
                if(g[v1].size() > g[v2].size()) swap(v1, v2);
                for(auto v3: g[v1]){
                    if(j < v3){
                        if(g[v3].size() > block){
                            if(bs[change[v3]][v2] == 1) upd(-1, i, j, v3);
                        }
                        else{
                            if(g[v2].size() > block){
                                if(bs[change[v2]][v3] == 1) upd(-1, i, j, v3);
                            }
                            else{
                                int vv2 = v2, vv3 = v3;
                                if(g[vv2].size() > g[vv3].size()) swap(vv2, vv3);
                                auto it = lower_bound(g[vv2].begin(), g[vv2].end(), vv3);
                                if(it != g[vv2].end() && *it == vv3) upd(-1, i, j, v3);
                            }
                        }
                    }
                }
            }
        }
    }
    cout << an << endl;
    //cout << stupid() << endl;
}


#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long uint;

int n, m;
int a, b, c;
uint an;
vector<int> g[200010];
const int block = 31;
const int maxn = 200000;
bitset<maxn> bs[maxn / block + 50];
int change[200010];

inline void upd(int x, int i, int j, int k){
    //cout << x << ' ' << i << ' ' << j << ' ' << k << endl;
    an += (uint)x * ((uint)i * a + (uint)j * b + (uint)k * c);
}

inline uint getsum(int l, int r){
    if(l > r) return 0;
    return (uint)(l+r) * (r-l+1) / 2;
}

uint stupid(){
    vector<int> g[20];
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            if(i == j) continue;
            bool ok = false;
            for(auto to: (::g[i])) if(to == j) ok = true;
            if(!ok) g[i].push_back(j);
        }
    }
    uint an = 0;
    char used[10000] = {};
    for(int i = 0; i < n; i++){
        for(auto to: g[i]){
            for(auto u: g[to]){
                auto it = lower_bound(g[i].begin(), g[i].end(), u);
                if(it != g[i].end() && *it == u){
                    int gg[3] = {i, to, u};
                    sort(gg, gg + 3);
                    if(!used[gg[0] * 100 + gg[1] * 10 + gg[2]]){
                        an += (uint)a * gg[0] + (uint)b * gg[1] + (uint)c * gg[2];
                    }
                    used[gg[0] * 100 + gg[1] * 10 + gg[2]] = true;
                }
            }
        }
    }
    return an;
}

main()
{
    ios_base::sync_with_stdio(false);
    cin >> n >> m;
    cin >> a >> b >> c;
    for(int i = 0; i < m; i++){
        int from, to;
        cin >> from >> to;
        g[from].push_back(to);
        g[to].push_back(from);
        int l = min(from, to), r = max(from, to);
        int mi = r - l - 1;
        an -= getsum(0, l-1)*a + l*(b*l + c*r);
        //cout << from << ' ' << to << ' ' << (int)an << endl;
        an -= getsum(l+1, r-1)*b + ((r-1)-(l+1)+1)*(a*l + c*r);
        //cout << from << ' ' << to << ' ' << (int)an << endl;
        an -= getsum(r+1, n-1)*c + ((n-1)-(r+1)+1)*(a*l + b*r);
        //cout << from << ' ' << to << ' ' << (int)an << endl;
        //cout << endl;
    }
    for(int i = 0; i < n; i++) sort(g[i].begin(), g[i].end());
    for(int i = 0; i < n; i++){
        int t = (uint)1 * (n - i - 1) * (n - i - 2) / 2;
        an += (uint)1 * a * i * t;
        t = (uint)1 * (i) * (n - i - 1);
        an += (uint)1 * b * i * t;
        t = (uint)1 * i * (i - 1) / 2;
        an += (uint)1 * c * i * t;
    }
    //cout << (int)an << endl;
    for(int i = 0; i < n; i++){
        int sum1 = 0, sum2 = 0;
        int cnt1 = 0, cnt2 = 0;
        for(int j: g[i]) if(j < i) sum1 += j, cnt1++; else sum2 += j, cnt2++;
        for(int j: g[i]){
            if(j < i){
                sum1 -= j;
                cnt1--;
                an += (uint)a * j * cnt2 + (uint)b * i * cnt2 + (uint)c * sum2;
                an += (uint)a * j * cnt1 + (uint)b * sum1 + (uint)c * i * cnt1;
            }
            else{
                sum2 -= j;
                cnt2--;
                an += (uint)a * i * cnt2 + (uint)b * j * cnt2 + (uint)c * sum2;
            }
            //if(i == 1) cout << (int)an << endl;
        }
    }
    /*for(int i = 0; i < n; i++){
        for(int j: g[i]){
            for(int k: g[i]){
                if(j < k){
                    int g[3] = {i, j, k};
                    sort(g, g + 3);
                    cout << "/ "; upd(1, g[0], g[1], g[2]);
                }
            }
        }
    }*/
    int lo = 0;
    for(int i = 0; i < n; i++){
        if(g[i].size() > block){
            change[i] = lo++;
            for(auto to: g[i]){
                bs[change[i]][to] = 1;
            }
        }
    }
    for(int i = 0; i < n; i++){
        for(int j: g[i]){
            if(i < j){
                int v1 = i;
                int v2 = j;
                if(g[v1].size() > g[v2].size()) swap(v1, v2);
                for(auto v3: g[v1]){
                    if(j < v3){
                        if(g[v3].size() > block){
                            if(bs[change[v3]][v2] == 1) upd(-1, i, j, v3);
                        }
                        else{
                            if(g[v2].size() > block){
                                if(bs[change[v2]][v3] == 1) upd(-1, i, j, v3);
                            }
                            else{
                                int vv2 = v2, vv3 = v3;
                                if(g[vv2].size() > g[vv3].size()) swap(vv2, vv3);
                                auto it = lower_bound(g[vv2].begin(), g[vv2].end(), vv3);
                                if(it != g[vv2].end() && *it == vv3) upd(-1, i, j, v3);
                            }
                        }
                    }
                }
            }
        }
    }
    cout << (int)an << endl;
    //cout << stupid() << endl;
}


#include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
vector<unsigned long long>edge[212121], redge[212121];
unsigned long long sum[212121];
unsigned long long deg[212121], col[212121];
unsigned long long bk = 500;
int main() {
	unsigned long long n, m, A, B, C; scanf("%llu%llu%llu%llu%llu", &n, &m, &A, &B, &C);
	unsigned long long i, j;
	unsigned long long ret = 0;
	for (i = 1; i <= n; i++) {
		unsigned long long cnt;
		cnt = (n - i) * (n - i - 1) / 2;
		ret += cnt * (i - 1) * A;
		cnt = (i - 1) * (n - i);
		ret += cnt * (i - 1) * B;
		cnt = (i - 1) * (i - 2) / 2;
		ret += cnt * (i - 1) * C;
	}
	for (i = 0; i < m; i++) {
		unsigned long long s, e; scanf("%llu%llu", &s, &e);
		if (s > e)swap(s, e);
		edge[s].push_back(e);
		redge[e].push_back(s);
		//i == s j == e k = 나머지
		unsigned long long cnt;
		if (e != n - 1) {
			cnt = (n - 1) - (e + 1) + 1;
			ret -= cnt * s * A;
			ret -= cnt * e * B;
			ret -= (n*(n - 1) / 2 - e*(e + 1) / 2) * C;
		}
		//i == s j == 나머지 k = e
		cnt = (e - 1) - (s + 1) + 1;
		if (cnt > 0) {
			ret -= cnt * s * A;
			ret -= ((e - 1) * e / 2 - s * (s + 1) / 2) * B;
			ret -= cnt * e * C;
		}
		//i == 나머지 j == s k = e
		if (s != 0) {
			cnt = s - 1 - 0 + 1;
			ret -= (s - 1) * s / 2 * A;
			ret -= cnt * s * B;
			ret -= cnt * e * C;
		}
	}
	for (i = 0; i < n; i++) {
		for (unsigned long long nxt : edge[i]) {
			sum[i] += nxt;
		}
	}
	for (i = 0; i < n; i++) {
		sort(edge[i].begin(), edge[i].end());
		sort(redge[i].begin(), redge[i].end());
	}
	for (i = 0; i < n; i++) {
		vector<int>LL;
		for (unsigned long long nxt : edge[i]) {
			unsigned long long cnt;
			cnt = edge[nxt].size();
			ret += cnt * i * A;
			ret += cnt * nxt * B;
			ret += sum[nxt] * C;
		}
		unsigned long long sz = edge[i].size();
		ret += sz * (sz - 1) / 2 * A * i;
		for (unsigned long long p = 0; p < edge[i].size(); p++) {
			unsigned long long cnt, nxt = edge[i][p];
			cnt = sz - p - 1;
			ret += cnt * nxt * B;
			cnt = p;
			ret += cnt * nxt * C;
		}
		sz = redge[i].size();
		ret += sz * (sz - 1) / 2 * C * i;
		for (unsigned long long p = 0; p < redge[i].size(); p++) {
			unsigned long long cnt, nxt = redge[i][p];
			cnt = sz - p - 1;
			ret += cnt * nxt * A;
			cnt = p;
			ret += cnt * nxt * B;
		}
	}

	for (i = 0; i < n; i++) {
		vector<int>vv;
		if (i == 3)
			int sp = 1;
		for (unsigned long long nxt : edge[i]) {
			col[nxt] = 1;
			if (edge[nxt].size() >= bk) {
				col[nxt] = 2;
				vv.push_back(nxt);
			}
		}
		for (unsigned long long nxt : edge[i]) {
			if (col[nxt] == 1) {
				for (unsigned long long nnxt : edge[nxt]) {
					if (col[nnxt]) {
						// i -> small -> (small & big)
						ret -= i * A + nxt * B + nnxt * C;
					}
				}
			}
			// i -> big -> (small & big)
			for (unsigned long long v : vv) {
				auto vvv = lower_bound(redge[nxt].begin(), redge[nxt].end(), v);
				if (vvv != redge[nxt].end() && *vvv == v) {
					// i -> v -> nxt
					ret -= i * A + v * B + nxt * C;
				}
			}
		}
		for (unsigned long long nxt : edge[i])col[nxt] = 0;
	}
	printf("%llu\n", ret);
	return 0;
}


#include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
vector<unsigned long long>edge[212121], redge[212121];
unsigned long long sum[212121];
unsigned long long deg[212121], col[212121];
unsigned long long bk = 500;
int main() {
	unsigned long long n, m, A, B, C; scanf("%llu%llu%llu%llu%llu", &n, &m, &A, &B, &C);
	unsigned long long i, j;
	unsigned long long ret = 0;
	for (i = 1; i <= n; i++) {
		unsigned long long cnt;
		cnt = (n - i) * (n - i - 1) / 2;
		ret += cnt * (i-1) * A;
		cnt = (i - 1) * (n - i);
		ret += cnt * (i-1) * B;
		cnt = (i - 1) * (i - 2) / 2;
		ret += cnt * (i-1) * C;
	}
	for (i = 0; i < m; i++) {
		unsigned long long s, e; scanf("%llu%llu", &s, &e);
		if (s > e)swap(s, e);
		edge[s].push_back(e);
		redge[e].push_back(s);
		//i == s j == e k = 나머지
		unsigned long long cnt;
		if (e != n - 1) {
			cnt = (n - 1) - (e + 1) + 1;
			ret -= cnt * s * A;
			ret -= cnt * e * B;
			ret -= (n*(n - 1) / 2 - e*(e + 1) / 2) * C;
		}
		//i == s j == 나머지 k = e
		cnt = (e - 1) - (s + 1) + 1;
		if (cnt > 0) {
			ret -= cnt * s * A;
			ret -= ((e - 1) * e / 2 - s * (s + 1) / 2) * B;
			ret -= cnt * e * C;
		}
		//i == 나머지 j == s k = e
		if (s != 0) {
			cnt = s - 1 - 0 + 1;
			ret -= (s - 1) * s / 2 * A;
			ret -= cnt * s * B;
			ret -= cnt * e * C;
		}
	}
	for (i = 0; i < n; i++) {
		for (unsigned long long nxt : edge[i]) {
			sum[i] += nxt;
		}
	}
	for (i = 0; i < n; i++) {
		sort(edge[i].begin(), edge[i].end());
		sort(redge[i].begin(), redge[i].end());
	}
	for (i = 0; i < n; i++) {
		vector<int>LL;
		for (unsigned long long nxt : edge[i]) {
			unsigned long long cnt;
			cnt = edge[nxt].size();
			ret += cnt * i * A;
			ret += cnt * nxt * B;
			ret += sum[nxt] * C;
		}
		unsigned long long sz = edge[i].size();
		ret += sz * (sz - 1) / 2 * A * i;
		for (unsigned long long p = 0; p < edge[i].size(); p++) {
			unsigned long long cnt, nxt = edge[i][p];
			cnt = sz - p - 1;
			ret += cnt * nxt * B;
			cnt = p;
			ret += cnt * nxt * C;
		}
		sz = redge[i].size();
		ret += sz * (sz - 1) / 2 * C * i;
		for (unsigned long long p = 0; p < redge[i].size(); p++) {
			unsigned long long cnt, nxt = redge[i][p];
			cnt = sz - p - 1;
			ret += cnt * nxt * A;
			cnt = p;
			ret += cnt * nxt * B;
		}
	}

	for (i = 0; i < n; i++) {
		vector<int>vv;
		for (unsigned long long nxt : edge[i]) {
			col[nxt] = 1;
			if (edge[nxt].size() >= bk) {
				col[nxt] = 2;
				vv.push_back(nxt);
			}
		}
		for (unsigned long long nxt : edge[i]) {
			if (col[nxt] == 1) {
				for (unsigned long long nnxt : edge[nxt]) {
					if (col[nnxt]) {
						// i -> small -> (small & big)
						ret -= i * A + nxt * B + nnxt * C;
					}
				}
			}
			else {
				// i -> big -> nxt(big)
				for (unsigned long long v : vv) {
					if (*lower_bound(redge[nxt].begin(), redge[nxt].end(), v) == v) {
						// i -> v -> nxt
						ret -= i * A + v * B + nxt * C;
					}
				}
			}

		}
		for (unsigned long long nxt : edge[i])col[nxt] = 0;
	}
	printf("%llu\n", ret);
	return 0;
}