import Foundation let S = Array(readLine()!) var (x,y) = (0,0) for i in S{ if i == "E"{x += 1} else if i == "W"{x -= 1} else if i == "N"{y += 1} else if i == "S"{y -= 1} } (x,y) = (abs(x),abs(y)) print(Double(x*x + y*y).squareRoot())