let i = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n')[0] let x = y = 0 Array.prototype.forEach.call(i, (e) => { if (e === 'N') y++ else if (e === 'E') x++ else if (e === 'W') x-- else y-- }) console.log(Math.sqrt(x * x + y * y))