#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  err(++it, args...);
}
int main(int argc, char const *argv[]) {
  int nodes, edges;
  cin >> nodes >> edges;
  int cost[nodes + 1];
  for (int i = 0; i < nodes; i++) {
    cin >> cost[i + 1];
  }
  vector<int> adj[nodes + 1];
  int cutNodes[nodes + 1];
  int u, v;
  for (int i = 0; i < edges; i++) {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  long long totalCost = 0;
  for (int i = 0; i < nodes; i++) {
    int nodeCost = cost[i];
    for (int j = 0; j < adj[i].size(); j++) {
      int node = adj[i][j];
      if (cutNodes[node] == 1) {
        continue;
      }
      int otherNodeCost = cost[node];
      if (nodeCost < otherNodeCost) {
        totalCost += nodeCost;
      } else {
        totalCost += otherNodeCost;
      }
    }
    cutNodes[i] = 1;
  }
  cout << totalCost << endl;
}
