import java.util.Scanner; public class Yukicoder113 { public static void main(String[] args) { String s = new Scanner(System.in).next(); double ew = 0, ns = 0; for (int i = 0; i < s.length(); i++) { switch(s.charAt(i)) { case 'N': ns++; break; case 'E': ew++; break; case 'W': ew--; break; case 'S': ns--; break; } } System.out.println(Math.hypot(ns, ew)); } }