import math a=input() b=a.count("N")-a.count("S") c=a.count("W")-a.count("E") print(math.sqrt(math.sqrt(abs(b))+math.sqrt(abs(c))))