import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) { BufferedReader buff = new BufferedReader(new InputStreamReader(System.in)); try { String line = buff.readLine(); int x = 0, y = 0; for (int i = 0; i < line.length(); ++i) { if (line.charAt(i) == 'N') { ++y; } else if (line.charAt(i) == 'E') { ++x; } else if (line.charAt(i) == 'S') { --y; } else { --x; } } double ans = Math.sqrt((Math.pow(x, 2) + Math.pow(y, 2))); System.out.println(ans); } catch (NumberFormatException e) { e.getStackTrace(); } catch (IOException e) { e.getStackTrace(); } catch (Exception e) { e.getStackTrace(); } } }