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