a = input() x = a.count('N') x -= a.count('S') y = a.count('E') y -= a.count('W') print((x*x + y*y) ** 0.5)