#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, v[1001], ans = 0, x, y;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &v[i]);
  }
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &x, &y);
    if (v[x] > v[y])
      ans += v[y];
    else
      ans += v[x];
  }
  printf("%d\n", ans);
  return 0;
}
