from math import sqrt S=input() y,x=0,0 for c in S: if c=='N': y+=1 elif c=='E': x+=1 elif c=='W': x-=1 elif c=='S': y-=1 print(sqrt(x*x+y*y))