import math s = input() hori = 0 vert = 0 for c in s: if c == 'N': vert += 1 elif c == 'S': vert -= 1 elif c == 'E': hori += 1 elif c == 'W': hori -= 1 res = math.sqrt(hori**2 + vert**2) print(res)