#include <bits/stdc++.h>
using namespace std;
int n, m;
bool rem[100000];
int e[100000];
vector<vector<int> > ad;
int main() {
  scanf("%d", &n);
  scanf("%d", &m);
  ad.resize(n);
  int tot = 0;
  vector<pair<int, int> > V;
  for (int i = 0; i < n; i++) {
    scanf("%d", &e[i]);
    V.push_back(make_pair(e[i], i));
  }
  int a, b;
  for (int i = 0; i < m; i++) {
    scanf("%d", &a);
    scanf("%d", &b);
    a--;
    b--;
    ad[a].push_back(b);
    ad[b].push_back(a);
  }
  sort(V.begin(), V.end(), greater<pair<int, int> >());
  for (int i = 0; i < (int)(V.size()); i++) {
    int v = V[i].second;
    rem[v] = true;
    for (typeof(ad[v].begin()) it = ad[v].begin(); it != ad[v].end(); it++) {
      if (rem[*it]) continue;
      tot += e[*it];
    }
  }
  cout << tot << endl;
  return 0;
}
