#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  ll t_time;
  ll a, b, c, d;
  cin >> t_time >> a >> b >> c >> d;
  ll count_a = 0;
  ll count_b = 0;
  string s;
  cin >> s;
  int n = s.size();
  for (int i = 0; i < n; i++) {
    if (a == c)
      break;
    else if (a < c) {
      count_a++;
      if (s[i] == 'E') {
        a++;
      }
    } else {
      count_a++;
      if (s[i] == 'W') {
        a--;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (b == d)
      break;
    else if (b < d) {
      count_b++;
      if (s[i] == 'N') {
        b++;
      }
    } else {
      count_b++;
      if (s[i] == 'S') {
        b--;
      }
    }
  }
  if (a != c || b != d)
    cout << -1 << endl;
  else
    cout << max(count_a, count_b) << endl;
  return 0;
}
