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