a = input() n = a.count("N") e = a.count("E") w = a.count("W") s = a.count("S") print(((n - s)**2 + (w - e)**2)**0.5)