p gets.chop.chars.reduce(0){|s,e|s+(e==?N?1:e==?S?-1:e==?E?1i:-1i)}.abs