#include "bits/stdc++.h" using namespace std; #define REP(i, n) for(int i=0; i<(n); i++) struct P { int x, y; P(){}; P(int _x, int _y): x(_x), y(_y){}; }; signed main() { string s; cin >> s; P p = P(0,0); for (auto&& t : s) { if (t == 'N') p.y++; if (t == 'S') p.y--; if (t == 'W') p.x++; if (t == 'E') p.x--; } printf("%.14f\n", sqrt(pow(p.x,2) + pow(p.y,2))); return 0; }