#include using namespace std; using ll = long long; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b A){ ll L = A.size(); FOR(i, 0, L){ if(i) cout << ' '; cout << A[i]; } cout << endl; } int main(){ cin.tie(0); ios::sync_with_stdio(false); // input string s; cin >> s; ll x = 0; ll y = 0; for(char c : s){ if(c=='N'){ y++; } else if(c=='S'){ y--; } else if(c=='E'){ x++; } else{ x--; } } double a = x*x + y*y; double ans = sqrt(a); cout << setprecision(20); p(ans); return 0; }