#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair i_i; typedef pair ll_i; typedef pair d_i; typedef pair ll_ll; typedef pair d_d; struct edge { int u, v; ll w; }; ll MOD = 1000000007; ll _MOD = 1000000009; double EPS = 1e-10; int INF = INT_MAX / 2; int main() { int x = 0, y = 0; string S; cin >> S; for (int i = 0; i < S.length(); i++) { if (S[i] == 'N') y++; if (S[i] == 'E') x++; if (S[i] == 'W') x--; if (S[i] == 'S') y--; } printf("%.10f\n", sqrt((double)x * x + y * y)); }