import math S=raw_input() L=list(S) x=0 y=0 for a in L: if a=='N': x+=1 elif a=='S': x-=1 elif a=='E': y+=1 elif a=='W': y-=1 print math.sqrt(x**2+y**2)