#include #define rep(i, ss, ee) for (int i = ss; i < ee; ++i) using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int x = 0, y = 0; string s; cin >> s; rep(i, 0, s.size()) { if (s[i] == 'N') y++; if (s[i] == 'S') y--; if (s[i] == 'E') x++; if (s[i] == 'W') x--; } double ans = sqrt(y * y + x * x); cout << ans << endl; getchar(); }