package m.shin; import java.util.Scanner; public class Con113 { public static void main(String[] args) { Scanner s = new Scanner(System.in); String root = s.next(); s.close(); int x = 0 , y = 0; for(int i = 0;i < root.length();i++){ switch(root.charAt(i)){ case 'N' : y++; break; case 'S' : y--; break; case 'E' : x++; break; case 'W' : x--; } } double ans = Math.sqrt(x*x + y*y); System.out.println(ans); } }