S = input() n = S.count('N') e = S.count('E') w = S.count('W') s = S.count('S') x = e - w y = n - s print((x**2 + y**2) ** 0.5)