Program PP1;
Var jie:array[1..20]of int64;
s:string;
l,i,k,ans:longint;
Begin
assign(input,'exp.in'); reset(input);
assign(output,'exp.out'); rewrite(output);
jie[1]:=2;
for i:=2 to 20 do jie[i]:=jie[i-1]*2;
readln(l);
readln(s);
ans:=1;
if s[1]<>'*' then k:=0 else k:=1;
for i:=2 to l do begin
if (s[i]='*')and(s[i-1]='*') then inc(k);
if (s[i]='+')and(s[i-1]='*') then begin
ans:=(jie[k+1]-1)*ans;
k:=0;
end;
if (s[i]='*')and(s[i-1]='+') then k:=1;
end;
if k<>0 then ans:=ans*(jie[k+1]-1);
writeln(ans);
close(input);
close(output);
End.