#include #include #include #include #include #include #include #include #include #include using namespace std; #define FOR(i,s,e) for (int i = int(s); i != int(e); i++) #define FORIT(i,c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); i++) #define ISEQ(c) (c).begin(), (c).end() int main(){ string s; cin >> s; int x = 0; int y = 0; FOR(i,0,s.length()){ if(s[i] == 'N') y++; else if(s[i]== 'S') y--; else if(s[i]=='E') x++; else x--; } double res = sqrt(x*x + y*y); cout << res << endl; return 0; }