#include <iostream> #include <algorithm> #include <string> #include <vector> #include <map> #include <set> #include <stdio.h> #include <cstring> #include <queue> #include <stack> #include <functional> #include <math.h> #include <iomanip> using namespace std; #define Would #define you const int INF = 999999999; const int MOD = 1e9 + 7; const double pi = 3.141592653589793238; int x, y; int main() { string h; cin >> h; for (char s : h) { switch (s) { case 'N': ++y; break; case 'E': ++x; break; case 'W': --x; break; case 'S': --y; break; } } cout << setprecision(20) << sqrt(x*x + y * y) << endl; }