s=input() x=s.count('E')-s.count('W') y=s.count('N')-s.count('S') print(pow(x*x+y*y,0.5))