#include"bits/stdc++.h" using namespace std; int main() { string s; cin >> s; double x, y; x=y=0; 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(x*x+y*y)); }