import math y, x = 0, 0 for s in input(): if s == "N": y += 1 elif s == "S": y -= 1 elif s == "E": x += 1 else: x -= 1 print(math.hypot(x, y))