s = input() counts = [0] * 4 # 0:North, 1:East, 2:West, 3:South directions = 'NEWS' for i in directions: counts[directions.index(i)] = s.count(i) print((((abs(counts[0]) - counts[3]) ** 2 + abs(counts[1] - counts[2]) ** 2)) ** 0.5)