package yukicoder113;
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		double x=0;
		double y=0;
		String str=sc.next();
		char[] c=str.toCharArray();
		for(int i=0;i<c.length;i++){
			if(c[i]=='N'){
				y++;
			}else if(c[i]=='S'){
				y--;
			}else if(c[i]=='W'){
				x--;			
			}else if(c[i]=='E'){
				x++;
			}
		}
		System.out.println(Math.sqrt(x*x+y*y));
	}
}