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