m = {'N': (0, 1), 'E': (1, 0), 'S': (0, -1), 'W': (-1, 0)} x, y = 0, 0 for c in input(): x += m[c][0] y += m[c][1] print((x**2 + y**2)**0.5)