#include <bits/stdc++.h>
using namespace std;
unsigned int *v = 0;
unsigned int vSize = 0;
unsigned int edgeSize = 0;
void init() {
  v = new unsigned int[vSize];
  for (unsigned int i = 0; i < vSize; ++i) {
    cin >> v[i];
  }
}
int minSpendEnergy() {
  unsigned int minTotalEnergy = 0;
  unsigned int uVertex = 0, vVertex = 0;
  for (unsigned int i = 0; i < edgeSize; ++i) {
    cin >> uVertex >> vVertex;
    minTotalEnergy =
        minTotalEnergy +
        (v[uVertex - 1] < v[vVertex - 1] ? v[uVertex - 1] : v[vVertex - 1]);
  }
  return minTotalEnergy;
}
void deleteAll() { delete[] v; }
int main() {
  while (cin >> vSize >> edgeSize) {
    init();
    cout << minSpendEnergy() << endl;
    deleteAll();
  }
  return 0;
}
