//Normal #define _GLIBCXX_DEBUG #define ll long long #include using namespace std; using Graph = vector>; void print(auto a){ cout << a; } void prints(auto a){ cout << a << " "; } void prints(){ cout << " "; } void printl(auto a){ cout << a << endl; } void printl(){ cout << endl; } void fix(int n){ cout << fixed << setprecision(n); } int main(){ string S; cin >> S; int siz = (int)S.size(); int h = 0, w = 0; for(int i = 0; i < siz; i++){ if(S[i] == 'N') h++; if(S[i] == 'E') w++; if(S[i] == 'W') w--; if(S[i] == 'S') h--; } double ans = sqrt(h*h + w*w); fix(10); printl(ans); return 0; }