#include <bits/stdc++.h>
using namespace std;
const int INF = (int)(INT_MAX - 100);
const int N = (int)(0);
const long long mod = (int)(1e+9 + 7);
string cx = "WE", cy = "SN";
int main() {
  int t, x, y, a, b;
  cin >> t >> x >> y >> a >> b;
  int dx = a - x, dy = b - y;
  bool bx = (dx > 0), by = (dy > 0);
  dx = abs(dx), dy = abs(dy);
  int kx = 0, ky = 0, m = 0;
  char z;
  for (int i = 0; i < t; i++) {
    cin >> z;
    if (z == cx[bx] && kx < dx) kx++;
    if (z == cy[by] && ky < dy) ky++;
    if (kx == dx && ky == dy) return printf("%d\n", i + 1), 0;
  }
  printf("%d\n", -1);
  return 0;
}
