S = input() x = abs(S.count("E")-S.count("W")) y = abs(S.count("N")-S.count("S")) print((x**2+y**2)**0.5)