#include <iostream>
#include <iomanip>
#include <cmath>
#include <vector>
#include <string>

using ldouble = long double;

const std::vector<ldouble> dx{0, 1, -1, 0}, dy{1, 0, 0, -1};

void solve() {
    std::string s;
    std::cin >> s;

    ldouble x = 0, y = 0;
    for (char c : s) {
        for (int i = 0; i < 4; ++i) {
            if (c == "NEWS"[i]) {
                x += dx[i];
                y += dy[i];
            }
        }
    }

    std::cout << std::fixed << std::setprecision(10)
              << std::hypot(x, y) << std::endl;
}

int main() {
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}