#include <bits/stdc++.h>
using namespace std;
struct Rope {
  int val, id;
  bool operator<(const Rope& a) const { return val > a.val; }
} ropes[1005];
bool vis[1005];
int vals[1005];
vector<int> edge[1005];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &vals[i]);
    ropes[i].val = vals[i];
    ropes[i].id = i;
    edge[i].clear();
  }
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    edge[x].push_back(y);
    edge[y].push_back(x);
  }
  sort(ropes + 1, ropes + 1 + n);
  memset(vis, 0, sizeof(vis));
  int res = 0;
  for (int i = 1; i <= n; i++) {
    int u = ropes[i].id;
    for (int j = 0; j < (int)edge[u].size(); j++) {
      int v = edge[u][j];
      if (!vis[v]) res += vals[v];
    }
    vis[u] = true;
  }
  printf("%d\n", res);
  return 0;
}
