#include "bits/stdc++.h" #define MOD 1000000007 #define INF 11234567890 #define in std::cin #define out std::cout #define rep(i,N) for(LL i=0;i> S; for (auto c : S) { switch (c) { case 'N': ++y; break; case 'E': ++x; break; case 'W': --x; break; case 'S': --y; break; } } out << sqrt(abs(x)*abs(x) + abs(y)*abs(y)) << std::endl; return 0; }