import math s = input() w = s.count("N") -s.count("S") h = s.count("W") -s.count("E") print(math.sqrt(w**2 + h**2))