import math s = list(input()) n = 0 m = 0 for i in range(len(s)): if s[i] == 'N': n += 1 elif s[i] == 'E': m += 1 elif s[i] == 'W': m -= 1 else: n -= 1 a = n ** 2 + m ** 2 print(math.sqrt(a))