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){ double x=0,y=0; for(int i = 0; i < point.length(); i++){ String now = point.substring(i,i+1); if(now.equals("N")){ y++; }else if(now.equals("E")){ x++; }else if(now.equals("W")){ x--; }else{ y--; } } System.out.println(Math.sqrt(x*x+y*y)); } }