#include #include #include #include #include #include #define REP(i, a, b) for (int i = int(a); i < int(b); i++) using namespace std; typedef long long int lli; int main() { string s; cin >> s; int x = 0, y = 0; REP (i, 0, s.size()) { if (s[i] == 'N') y++; else if(s[i] == 'E') x++; else if(s[i] == 'W') x--; else y--; } cout << fixed << setprecision(10) << hypot(x, y) << endl; return 0; }