#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    long long int n, i, cw = 0, a, b, c, d, ce = 0, cn = 0, cs = 0;
    cin >> n >> a >> b >> c >> d;
    long long int ae = 0, aw = 0, as = 0, an = 0;
    string s;
    cin >> s;
    long long int nn = 0, ns = 0, ne = 0, nw = 0;
    if (a == c && b == d)
      cout << 0;
    else {
      if (a >= c)
        nw = abs(c - a);
      else
        ne = abs(a - c);
      if (d >= b)
        nn = abs(b - d);
      else
        ns = abs(d - b);
    }
    if (nw)
      for (i = 0; i < n; i++) {
        if (s[i] == 'W') cw++;
        if (cw == nw) {
          aw = cw;
          cw = i;
          break;
        }
      }
    if (ne)
      for (i = 0; i < n; i++) {
        if (s[i] == 'E') ce++;
        if (ce == ne) {
          ae = ce;
          ce = i;
          break;
        }
      }
    if (nn)
      for (i = 0; i < n; i++) {
        if (s[i] == 'N') cn++;
        if (cn == nn) {
          an = cn;
          cn = i;
          break;
        }
      }
    if (ns)
      for (i = 0; i < n; i++) {
        if (s[i] == 'S') cs++;
        if (cs == ns) {
          as = cs;
          cs = i;
          break;
        }
      }
    if (aw < nw || ae < ne || an < nn || as < ns)
      cout << -1;
    else {
      cout << max({cw + 1, ce + 1, cn + 1, cs + 1});
    }
    cout << endl;
  }
}
