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