from math import sqrt S = input() n = len(S) directions = {'N': (0, 1), 'E': (1, 0), 'W': (-1, 0), 'S': (0, -1)} x, y = 0, 0 for i in range(n): dx, dy = directions[S[i]] x += dx y += dy print(sqrt(x**2 + y**2))