uses crt;
var fin,fout:text;
    z,i,count:integer;
    str:string;
    check:boolean;
begin
clrscr;
  assign(fin,'DATA2.txt');
  reset(fin);
  assign(fout,'OUT2.txt');
  rewrite(fout);
  for z:=1 to 5 do
  begin
    readln(fin,str);
    check:=false;
    for i:=1 to length(str) do
    begin
      if str[i]='+' then
        count:=count+1;
      if str[i]='-' then
        count:=count-1;
      if count<0 then
         check:=true;
    end;
    if check=false then
      writeln(fout,count);
    if check=true then
    begin
      count:=0;
      writeln(fout,'OH NOES!');
    end;
  end;
  close(fin);
  close(fout);
end.
