s = input() c = lambda i: s.count(i) x = c('E') x -= c('W') y = c('N') y -= c('S') print((x*x + y*y)**0.5)