const input = require("fs").readFileSync("/dev/stdin", "utf8"); const chars = input.split(''); const o = { N: 0, S: 0, E: 0, W: 0, }; chars.forEach(c => { if (o.hasOwnProperty(c)) { o[c]++; } }) console.log(Math.sqrt(Math.pow(o.N - o.S, 2) + Math.pow(o.E - o.W, 2)));