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