#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); string s; cin >> s; int x = 0,y = 0; for(auto c : s){ if(c == 'N') x++; else if(c == 'S') x--; else if(c == 'W') y++; else y--; } cout << fixed << setprecision(20) << sqrt(x*x+y*y) << endl; }