#include using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); string s; cin >> s; double x = 0, y = 0; for(int i = 0; i < s.size(); i++) { if(s[i] == 'N') y++; if(s[i] == 'E') x++; if(s[i] == 'W') x--; if(s[i] == 'S') y--; } cout << setprecision(20) << (double)sqrt(x * x + y * y) << '\n'; return 0; }