import java.util.*; public class searchBox{ public static void main(String... args){ Scanner scan = new Scanner(System.in); String point = scan.next(); DoSearch(point); } public static void DoSearch(String point){ int[] count_point = {0,0,0,0};//N,E,W,S for(int i = 0; i < point.length(); i++){ String now = point.substring(i,i+1); if(now.equals("N")){ count_point[0]+=1; }else if(now.equals("E")){ count_point[1]+=1; }else if(now.equals("W")){ count_point[2]+=1; }else{ count_point[3]+=1; } } int[] right = {count_point[1],count_point[0]};//x,y int[] left = {count_point[2]*(-1),count_point[3]*(-1)}; double x = Math.pow(right[0]+left[0],2); double y = Math.pow(right[1]+left[1],2); System.out.println(Math.sqrt(x+y)); } }