The polar bears are going fishing. They plan to sail from (*s*<sub class="lower-index">*x*</sub>, *s*<sub class="lower-index">*y*</sub>) to (*e*<sub class="lower-index">*x*</sub>, *e*<sub class="lower-index">*y*</sub>). However, the boat can only sail by wind. At each second, the wind blows in one of these directions: east, south, west or north. Assume the boat is currently at (*x*, *y*).
 -  If the wind blows to the east, the boat will move to (*x* + 1, *y*). -  If the wind blows to the south, the boat will move to (*x*, *y* - 1). -  If the wind blows to the west, the boat will move to (*x* - 1, *y*). -  If the wind blows to the north, the boat will move to (*x*, *y* + 1). 
Alternatively, they can hold the boat by the anchor. In this case, the boat stays at (*x*, *y*). Given the wind direction for *t* seconds, what is the earliest time they sail to (*e*<sub class="lower-index">*x*</sub>, *e*<sub class="lower-index">*y*</sub>)?
The first line contains five integers *t*, *s*<sub class="lower-index">*x*</sub>, *s*<sub class="lower-index">*y*</sub>, *e*<sub class="lower-index">*x*</sub>, *e*<sub class="lower-index">*y*</sub> (1 ≤ *t* ≤ 10<sup class="upper-index">5</sup>,  - 10<sup class="upper-index">9</sup> ≤ *s*<sub class="lower-index">*x*</sub>, *s*<sub class="lower-index">*y*</sub>, *e*<sub class="lower-index">*x*</sub>, *e*<sub class="lower-index">*y*</sub> ≤ 10<sup class="upper-index">9</sup>). The starting location and the ending location will be different.

The second line contains *t* characters, the *i*-th character is the wind blowing direction at the *i*-th second. It will be one of the four possibilities: "E" (east), "S" (south), "W" (west) and "N" (north).
import math
#from decimal import *
#from collections import deque
def produs_cifre(numar):
 
 produs=1
 for i in numar:
  produs=produs*int(i)
 return (produs)
 
#def prime_generator(nr_elemente_prime):
 
 #vector_prime=[-1]*nr_elemente_prime
 #vector_rasp=[0]*nr_elemente_prime
 
 #vector_prime[1]=1
 
 #vector_rasp[1]=1
#primes sieve 
 #contor=2
 
 #for i in range(2,nr_elemente_prime):
 # if vector_prime[i]==-1:
 #  vector_prime[i]=1
 #  vector_rasp[contor]=i
 #  contor=contor+1
 # for j in range(i+i,nr_elemente_prime,i):
   # if vector_prime[j]==-1:
   #  vector_prime[j]=i
   #print(i,j) 
 
# my_set=set(vector_rasp)
 #my_set.remove(0)
 #my_set.remove(1)
 pr
 #lista_prime=list(my_set)
 #lista_prime.sort()
 #return my_set


def functie(nodul,vectorul,cate,culori,vizitat):
 #print(noi_culori)
 if vizitat[nodul]==0:
  vizitat[nodul]=1
  
  
  if culori[nodul-1]!=noi_culori[nodul-1]:
   #print(nodul)
   cate[0]=1+cate[0]
   noi_culori[nodul-1]=culori[nodul-1]
  
    
  for j in vectorul[nodul]:
    if vizitat[j]==0:
     noi_culori[j-1]=culori[nodul-1]
     functie(j,vectorul,cate,culori,vizitat)
     
 return(sum(cate))



#z=int(input())
for contor in range(0,1):

 t,x,y,ex,ey=list(map(int,input().split()))
 #n=int(input())
 stringul=input()
 n=len(stringul)
 
 
 est=0
 vest=0
 nord=0
 sud=0
 adev=0
 my_dict={}
 
 if ex>x:
  est=ex-x
  my_dict['E']=est
  
 elif  x>ex:
  vest=x-ex
  my_dict['V']=vest
  
  
 if ey>y:
  nord=ey-y
  my_dict['N']=nord
  
 elif  y>ey:
  sud=y-ey
  my_dict['S']=sud
  
 pozitie=-1
 if x==ex and y==ey:
  print(0)
 else:
  
  for j in range(n):
   i=stringul[j]
   if i in my_dict:
    if my_dict[i]>0:
     my_dict[i]-=1
     pozitie=j
     
     #print(j,i)
     
     if my_dict[i]==0:
      del my_dict[i]
    
     
  #print(my_dict)
  
  pozitie+=1
  if pozitie<=t and len(my_dict)==0:
   print(int(pozitie))
  else:
   print(-1)
   
  
 