import math S = input() x, y = 0, 0 for i in S: if(i == 'N'): y += 1 elif(i == 'E'): x += 1 elif(i == 'W'): x -= 1 else: y -= 1 print(math.sqrt(x**2 + y**2))