S = input() x = 0 y = 0 for i in S: if i == 'E': x += 1 elif i == 'W': x -= 1 elif i == 'N': y += 1 else: y -= 1 print((x**2 + y**2)**0.5)