#! ruby # yukicoder My Practice # author: Leonardone @ NEETSDKASU S = gets.chomp x = (S.count('W') - S.count('E')).abs y = (S.count('N') - S.count('S')).abs length = (x * x + y * y) ** 0.5 puts length