#include "iostream" #include "math.h" using namespace std; char letter[200]; int x, y; double ans; int main() { cin >> letter; for (int i = 0; letter[i] != NULL; i++) { if (letter[i] == 'N')y++; else if (letter[i] == 'S')y--; else if (letter[i] == 'W')x++; else x--; } ans = sqrt(float(x)*float(x) + float(y)*float(y)); cout << ans << "\n"; return 0; }