#include<iostream> #include<string> #include<math.h> using namespace std; int main() { string s; cin >> s; double height=0.0, width=0.0; for(int i=0; i<s.length(); i++) { if(s[i] == 'N') { height+=1.0; } else if(s[i] == 'S') { height-=1.0; } else if(s[i] == 'W') { width-=1.0; } else if(s[i] == 'E') { width+=1.0; } } double result = sqrt(height*height + width*width); cout << result << endl; return 0; }