#include <bits/stdc++.h>
using namespace std;
const int maxn = 1020;
int a, b;
int used[maxn], as[maxn];
pair<int, int> ar[maxn];
vector<int> w[maxn];
int main() {
  scanf("%d %d", &a, &b);
  for (int i = 1; i <= a; i++) scanf("%d", &ar[i].first), ar[i].second = i;
  sort(ar + 1, ar + 1 + a);
  reverse(ar + 1, ar + 1 + a);
  for (int i = 1; i <= a; i++) as[ar[i].second] = ar[i].first;
  for (int i = 1; i <= b; i++) {
    int j, k;
    scanf("%d %d", &j, &k);
    w[j].push_back(k);
    w[k].push_back(j);
  }
  int ans = 0;
  for (int i = 1; i <= a; i++) {
    for (int j = 0; j < w[ar[i].second].size(); j++)
      if (!used[w[ar[i].second][j]]) ans += as[w[ar[i].second][j]];
    used[ar[i].second] = 1;
  }
  printf("%d\n", ans);
  return 0;
}
