#include "bits/stdc++.h" using namespace std; int main() { string S; int NS = 0, EW = 0; cin >> S; for (int i = 0; i < S.size(); i++) { if (S[i] == 'N') NS++; if (S[i] == 'S') NS--; if (S[i] == 'E') EW++; if (S[i] == 'W') EW--; } double x = NS * NS + EW * EW; cout << sqrt(x) << endl; }