#include <bits/stdc++.h>
using namespace std;
const int MAX = 210000;
const int INF = 1000000000;
const int MOD = 1000000007;
const int MX = 700;
unsigned long long mod(unsigned long long a, unsigned long long b,
                       unsigned long long m) {
  unsigned long long ret = 1;
  a %= m;
  while (b) {
    if (b & 1) ret = ret * a % m;
    b >>= 1;
    a = a * a % m;
  }
  return ret;
}
unsigned long long inv(unsigned long long a) { return mod(a, MOD - 2, MOD); }
unsigned long long vabs(unsigned long long x) { return x > 0 ? x : -x; }
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  return a % b ? gcd(b, a % b) : b;
}
int cross(pair<int, int> a, pair<int, int> b) {
  return a.first * b.second - a.second * b.first;
}
int dir[4][2] = {{-1, 0}, {0, -1}, {1, 0}, {0, 1}};
int dblcmp(double x) {
  if (fabs(x) < 1e-8) return 0;
  return x < 0 ? -1 : 1;
}
unsigned long long Cn2(unsigned long long n) { return n * (n - 1) / 2; }
vector<int> pre[MAX];
vector<int> suf[MAX];
bool has[MX][MAX];
void addEdge(int u, int v) {
  if (v < u)
    pre[u].push_back(v);
  else
    suf[u].push_back(v);
}
unsigned long long conSum(unsigned long long a, unsigned long long b) {
  if (a > b) return 0;
  return (a + b) * (b - a + 1) / 2;
}
unsigned long long getThree(unsigned long long A, unsigned long long B,
                            unsigned long long C, vector<int>& a,
                            vector<int>& b, unsigned long long second,
                            unsigned long long third) {
  int n = a.size();
  int m = b.size();
  int test = 0;
  int i, j;
  unsigned long long ans = 0;
  unsigned long long der = B * second + C * third;
  while ((1 << test) < m) test++;
  if (false && n * test < n + m) {
    for (i = 0; i < n; i++) {
      vector<int>::iterator it = lower_bound(b.begin(), b.end(), a[i]);
      if (it != b.end() && *it == a[i]) {
        ans += A * a[i] + der;
      }
    }
  } else {
    i = 0;
    j = 0;
    while (i < n && j < m) {
      if (a[i] < b[j])
        i++;
      else if (a[i] > b[j])
        j++;
      else {
        ans += A * a[i] + der;
        i++;
        j++;
      }
    }
  }
  return ans;
}
int id[MAX];
set<pair<int, int> > st;
int to[MAX] = {0};
int main() {
  unsigned long long i, j;
  int T = 0;
  unsigned long long n, m;
  cin >> n >> m;
  unsigned long long A, B, C;
  cin >> A >> B >> C;
  unsigned long long ans = 0;
  st.clear();
  int sq = sqrt(m * 1.0);
  memset(id, -1, sizeof(int) * (n + 5));
  for (i = 0; i < n; i++) {
    ans += A * i * Cn2(n - 1 - i);
    ans += B * i * (i) * (n - 1 - i);
    ans += C * i * Cn2(i);
  }
  int u, v;
  for (i = 0; i < n; i++) {
    pre[i].clear();
  }
  for (i = 0; i < n; i++) {
    suf[i].clear();
  }
  for (i = 0; i < m; i++) {
    scanf("%d%d", &u, &v);
    addEdge(u, v);
    addEdge(v, u);
    if (u > v) swap(u, v);
    st.insert(make_pair(u, v));
    ans -= (A * u + B * v) * (n - 1 - v) + C * conSum(v + 1, n - 1);
    ans -= (B * u + C * v) * (u) + A * conSum(0, u - 1);
    ans -= (A * u + C * v) * (v - u - 1) + B * conSum(u + 1, v - 1);
  }
  for (i = 0; i < n; i++) {
    sort(pre[i].begin(), pre[i].end());
    sort(suf[i].begin(), suf[i].end());
  }
  int last = 0;
  for (i = 0; i < n; i++) {
    if (pre[i].size() + suf[i].size() > sq) {
      memset(has[last], false, sizeof(bool) * (n + 5));
      id[i] = last++;
      for (j = 0; j < pre[i].size(); j++) {
        has[id[i]][pre[i][j]] = true;
      }
      for (j = 0; j < suf[i].size(); j++) {
        has[id[i]][suf[i][j]] = true;
      }
    }
  }
  for (i = 0; i < n; i++) {
    ans += B * i * pre[i].size() * suf[i].size();
    for (j = 0; j < pre[i].size(); j++) {
      ans += A * pre[i][j] * suf[i].size();
    }
    for (j = 0; j < suf[i].size(); j++) {
      ans += C * suf[i][j] * pre[i].size();
    }
    ans += A * i * Cn2(suf[i].size());
    for (j = 0; j < suf[i].size(); j++) {
      ans += B * suf[i][j] * (suf[i].size() - j - 1);
      ans += C * suf[i][j] * (j);
    }
    ans += C * i * Cn2(pre[i].size());
    for (j = 0; j < pre[i].size(); j++) {
      ans += A * pre[i][j] * (pre[i].size() - 1 - j);
      ans += B * pre[i][j] * (j);
    }
  }
  for (i = 0; i < n; i++) {
    if (id[i] != -1) {
      for (int second = 0; second < pre[i].size(); second++) {
        int u = pre[i][second];
        for (int first = 0; first < pre[u].size(); first++) {
          int v = pre[u][first];
          if (has[id[i]][v]) {
            ans -= A * v + B * u + C * i;
          }
        }
      }
    } else {
      for (int second = 0; second < pre[i].size(); second++) {
        int u = pre[i][second];
        if (id[u] == -1) {
          T++;
          for (vector<int>::iterator x = pre[u].begin(); x != pre[u].end();
               x++) {
            to[*x] = T;
          }
        }
        for (int first = 0; first < second; first++) {
          int v = pre[i][first];
          if (id[u] != -1) {
            if (has[id[u]][v]) {
              ans -= A * v + B * u + C * i;
            }
          } else if (to[v] == T) {
            ans -= A * v + B * u + C * i;
          }
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}
