#include using namespace std; typedef long long ll; typedef string str; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); str s; cin >> s; ll x = 0, y = 0; for (char c : s) { if (c == 'N') y++; else if (c == 'S') y--; else if (c == 'E') x++; else if (c == 'W') x--; } double p = sqrt(1.0 * x * x + 1.0 * y * y); if (p == floor(p)) cout << (ll)p << "\n"; else cout << fixed << setprecision(5) << p << "\n"; return 0; }