import math x, y = 0, 0 for s in list(input()): if s == 'N': y += 1 elif s == 'E': x += 1 elif s == 'W': x -= 1 else: y -= 1 print(math.sqrt(pow(abs(x),2)+pow(abs(y),2)))