# -*- coding: utf-8 -*- # No.113 宝探し import math s = raw_input() N = s.count('N') E = s.count('E') W = s.count('W') S = s.count('S') result1 = N ** 2 + E ** 2 + W ** 2 + S ** 2 result = math.sqrt(result1) print result