#include <bits/stdc++.h>
int main(void) {
  int i;
  int n, m, v[1000], ans;
  scanf("%d %d", &n, &m);
  for (i = 0; i < n; i++) scanf("%d", v + i);
  ans = 0;
  for (i = 0; i < m; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    x--;
    y--;
    ans += (((v[x]) < (v[y])) ? (v[x]) : (v[y]));
  }
  printf("%d\n", ans);
  return 0;
}
