Mikroskil Robotic Club (MiRC) is a fun club for robotics enthusiast where the members often come up with strange yet interesting ideas. Their dream is to build an intelligent humanoid robot which can replace them in semesters' exams.

To join MiRC, you have to solve a certain simple problem. Let there be a cartesian grid where a robot is placed at its origin (0, 0). The robot has the ability to accept and execute several commands:

- N - move one step to the north: from (x, y) to (x, y+1).
- S - move one step to the south: from (x, y) to (x, y-1).
- E - move one step to the east: from (x, y) to (x+1, y).
- W - move one step to the west: from (x, y) to (x-1, y).

With this movement system, each coordinate can actually be represented as a set of robot's movement. For example,

- WENNWNNW corresponds to coordinate (-1, 4), i.e. (0, 0) → (-1, 0) → (0, 0) → (0, 1) → (0, 2) → (-1, 2) → (-1, 3) → (-1, 4) → (-2, 4).
- SSSS corresponds to coordinate (0, -4), i.e. (0, 0) → (0, -1) → (0, -2) → (0, -3) → (0, -4).
- NNEEES corresponds to coordinate (3, 1), i.e. (0, 0) → (0, 1) → (0, 2) → (1, 2) → (2, 2) → (3, 2) → (3, 1).
- EENEEEWW corresponds to coordinate (3, 1), i.e. (0, 0) → (1, 0) → (2, 0) → (2, 1) → (3, 1) → (4, 1) → (5, 1) → (4, 1) → (3, 1).
- etc.

Let string S represents the robot's movement which corresponds to a coordinate (x, y). Your task is to determine the length of the shortest string which also corresponds to the same coordinate (x, y). As you can see from the examples above, NNEEES and EENEEEWW correspond to the same coordinate (3, 1), and NNEEES is shorter with the length of 6. However, the shortest possible string which corresponds to coordinate (3, 1) has the length of 4, i.e. any of NEEE, ENEE, EENE, EEEN.

MiRC wants to filter applicants who cannot solve this simple problem (i.e. those who just want to cling to MiRC famous name). We find this problem interesting, thus, we set this for IdeaFuse 2018 Qualification Round. Write a program to solve this problem and prove that you are a better coder.

Input contains a string S (1 ≤ S ≤ 1,000) in a single line. String S represents the robot's movements and consists of only characters N, S, E, and W. The meaning of each character can be found in the problem statement.

Output in a line an integer representing the output for the given input.

input | Example #1 |

EENEEEWW | |

output | |

4 | |

explanation | |

This is the example given in the problem statement. |

input | Example #2 |

SSSS | |

output | |

4 | |

explanation | |

The given input already has the shortest length possible. |

input | Example #3 |

WENNWNNW | |

output | |

6 | |

explanation | |

One example: NNWNNW |

input | Example #4 |

NEWS | |

output | |

0 | |

explanation | |

Empty string (length = 0) also produces the same coordinate, (0, 0). |

*End of Problem*