{
TASK:flower
LANG:PASCAL
}

program flower;

const CTable: array['E'..'W'] of Byte = (3,0,0,0,0,0,0,0,0,1,0,0,0,0,2,0,0,0,4);

var N: Integer;
    Fls: array[1..4] of Integer;

procedure Input;
var ALine: String;
    Pos, Lng: Integer;
begin
 ReadLn(N);

 ReadLn(ALine);

 Inc(Fls[CTable[ALine[1]]]);

 Lng := Length(ALine);
 If (Lng > 1) then begin

  Pos := 3;
  while (Pos <= Lng) do begin

   Inc(Fls[CTable[ALine[Pos]]]);
   Inc(Pos,2);

  end;

 end;
end;


function Combs(Sall, Eall: Integer): Int64;
var Res: Int64;
begin
 If (Fls[1] + Fls[2] + Fls[3] + Fls[4] = 0) then begin
  Combs := 0;
  Exit;
 end;

 Res := -1;

//North
 If (Fls[1] > 0) then begin
  Dec(Fls[1]);
  Inc(Res,1 + Combs(Sall + 1,Eall));
  Inc(Fls[1]);
 end;

//West
 If (Fls[4] > 0) then begin
  Dec(Fls[4]);
  Inc(Res,1 + Combs(Sall,Eall + 1));
  Inc(Fls[4]);
 end;

//South
 If (Fls[2] > 0) and (Sall > 0) then begin
  Dec(Fls[2]);
  Inc(Res,1 + Combs(Sall - 1,Eall));
  Inc(Fls[2]);
 end;

//East
 If (Fls[3] > 0) and (Eall > 0) then begin
  Dec(Fls[3]);
  Inc(Res,1 + Combs(Sall,Eall - 1));
  Inc(Fls[3]);
 end;

 Combs := Res;
end;


begin
 FillChar(Fls,SizeOf(Fls),0);

 Input;

 WriteLn(Combs(0,0));
end.