#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int t, sr, sc, er, ec;
  cin >> t >> sr >> sc >> er >> ec;
  string s;
  cin >> s;
  map<char, long long int> mp;
  if (sr - er > 0) {
    for (long long int i = 0; i < sr - er; i++) {
      mp['W']++;
    }
  } else {
    for (long long int i = 0; i < abs(sr - er); i++) {
      mp['E']++;
    }
  }
  if (sc - ec > 0) {
    for (long long int i = 0; i < sc - ec; i++) {
      mp['S']++;
    }
  } else {
    for (long long int i = 0; i < abs(sc - ec); i++) {
      mp['N']++;
    }
  }
  for (long long int i = 0; i < s.size(); i++) {
    if (mp.size() > 0 and mp.find(s[i]) != mp.end()) {
      mp[s[i]]--;
      if (mp[s[i]] < 1) {
        mp.erase(s[i]);
      }
    }
    if (mp.size() == 0) {
      cout << i + 1 << endl;
      return;
    }
  }
  cout << -1;
}
int32_t main() {
  long long int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
