# -*- coding: utf-8 -*- inp = list(raw_input()) N = float(inp.count("N")) E = float(inp.count("E")) W = float(inp.count("W")) S = float(inp.count("S")) print ((N - S) ** 2 + (E - W) ** 2) ** 0.5