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