import math r = raw_input() c = r.count print math.sqrt(abs(c('N')-c('S'))**2+abs(c('W')-c('E'))**2)