#include using namespace std; int main() { string S; cin >> S; int x = 0, y = 0; for (int i = 0; i < S.size(); i++) { if (S.at(i) == 'N') y++; if (S.at(i) == 'E') x++; if (S.at(i) == 'W') x--; if (S.at(i) == 'S') y--; } cout << sqrt(x * x + y * y) << "\n"; }