#include #include #include #include using namespace std; int main() { string s; cin >> s; int nn = count(s.begin(), s.end(), 'N'); int ne = count(s.begin(), s.end(), 'E'); int ns = count(s.begin(), s.end(), 'S'); int nw = count(s.begin(), s.end(), 'W'); double ans = sqrt(pow(nn - ns, 2) + pow(ne - nw, 2)); cout << ans << endl; return 0; }