S = input() X, Y = 0, 0 for I in S: if I == "N": X += 1 if I == "E": Y += 1 if I == "W": Y -= 1 if I == "S": X -= 1 print((X ** 2 + Y ** 2) ** 0.5)