#include <bits/stdc++.h>
int a[1100];
int main() {
  int n, m;
  while (scanf("%d %d", &n, &m) != EOF) {
    for (int i = 0; i < n; ++i) {
      scanf("%d", a + i);
    }
    long long result = 0;
    while (m--) {
      int p, q;
      scanf("%d %d", &p, &q);
      result += (a[p - 1] > a[q - 1] ? a[q - 1] : a[p - 1]);
    }
    printf("%I64d\n", result);
  }
  return 0;
}
