#include using namespace std; int main() { string S; cin >> S; int x = 0, y = 0; for (auto& c : S) { x += (c == 'E'); x -= (c == 'W'); y += (c == 'N'); y -= (c == 'S'); } cout << sqrt(pow(x, 2) + pow(y, 2)) << endl; }