import math dat = input() pos = [0, 0] for i in dat: if(i == 'W' or i == 'E'): pos[0] += -1 if i == 'W' else 1 else: pos[1] += -1 if i == 'S' else 1 print(round(math.sqrt(pos[0]**2 + pos[1]**2), 5))