s = input() x = 0 y = 0 for i in s: if i == "N": y += 1 elif i == "S": y -= 1 elif i == "E": x += 1 else: x -= 1 print(f'{(x**2 + y**2)**0.5:.05f}')