#include <bits/stdc++.h>
using namespace std;
const long long max_sz = 1e5 + 1;
const long long mod = 1e9 + 7;
char flip(char k) {
  if (k == '0') return '1';
  return '0';
}
long long sum_digit(long long n) {
  long long a = 0, i;
  for (i = n; i > 0; i = i / 10) {
    a += (i % 10);
  }
  return a;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  long long t;
  t = 1;
  while (t--) {
    int n, m;
    cin >> n >> m;
    vector<long long> v(n);
    for (int i = 0; i < n; ++i) cin >> v[i];
    vector<pair<long long, long long>> p;
    while (m--) {
      long long x, y;
      cin >> x >> y;
      p.push_back(make_pair(x, y));
    }
    long long jhc = 0;
    for (long long i = 0; i < p.size(); i++) {
      jhc += min(v[p[i].first - 1], v[p[i].second - 1]);
    }
    cout << jhc << endl;
  }
  cerr << endl
       << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
  return 0;
}
