#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, x1, x2, y1, y2;
  cin >> n >> x1 >> y1 >> x2 >> y2;
  string A;
  cin >> A;
  long long int pos1, pos2, pos3, pos4;
  pos1 = -1;
  pos2 = -1;
  pos3 = -1;
  pos4 = -1;
  if (x1 == x2 && y1 == y2) {
    cout << 0 << endl;
  } else {
    for (long long int i = 0; i < n; i++) {
      if (x2 > x1) {
        if (A[i] == 'E') {
          x1 = x1 + 1;
          if (x1 == x2) {
            pos1 = i + 1;
          }
        }
      }
      if (x2 < x1) {
        if (A[i] == 'W') {
          x1 = x1 - 1;
          if (x1 == x2) {
            pos2 = i + 1;
          }
        }
      }
      if (y2 > y1) {
        if (A[i] == 'N') {
          y1 = y1 + 1;
          if (y1 == y2) {
            pos3 = i + 1;
          }
        }
      }
      if (y2 < y1) {
        if (A[i] == 'S') {
          y1 = y1 - 1;
          if (y1 == y2) {
            pos4 = i + 1;
          }
        }
      }
    }
    long long int z;
    z = max(max(max(pos1, pos2), pos3), pos4);
    if (x1 == x2 && y1 == y2) {
      cout << z << endl;
    } else {
      cout << -1 << endl;
    }
  }
}
