import math a=input() e=a.count("E") n=a.count("N") w=a.count("W") s=a.count("S") b=e+n+w+s print(math.sqrt(b))