#include //cin, cout #include //vector #include //sort,min,max,count #include //string,getline, to_string #include //abs(int) #include //swap, pair #include //deque #include //INT_MAX #include //bitset #include //sqrt, ceil. M_PI, pow, sin #include //fixed #include //setprecision using namespace std; int main() { string S; cin >> S; int x = 0, y = 0; for (unsigned int i = 0; i < S.length(); i++) { switch (S[i]) { case 'N': y++; break; case 'E': x++; break; case 'W': x--; break; case 'S': y--; break; } } double ans = sqrt(x * x + y * y); cout << fixed << setprecision(4) << ans << endl; return 0; }