#include "bits/stdc++.h" using namespace std; int main(){ string S; cin >> S; int x = 0, y = 0; for (char C : S){ switch (C){ case 'N': y++; break; case 'E': x++; break; case 'W': x--; break; case 'S': y--; break; } } printf("%.14f\n", hypot(x, y)); }