program problem_02;

var
   balance: string;
   count_negative, count_positive, i, j, total: integer;
   problem,solution: text;

begin
assign(problem, 'data2.txt');
reset(problem);
assign(solution, 'out2.txt');
rewrite(solution);
count_positive := 0;
count_negative := 0;

                       total:=0;
for j := 1 to 5 do
begin
readln(problem,balance);
for i := 1 to length(balance) do
    begin
    if ord(balance[i]) = 43 then
//          count_positive := count_positive + 1
total := total + 1
          else
          begin
//          count_negative := count_negative + 1;
total := total -1;
          end;
//    total := total + count_positive - count_negative;
//    writeln(i,' ',total); readln;
      if total < 0 then
      begin
      total := 0;
           break;
         end;


    end;


if total > 0 then
         if j = 5 then
            write(solution,total) else
        writeln(solution,total)
        else
        begin
        writeln(solution,'OH NOES!');   total:=0;
        end;
                 count_positive := 0;
        count_negative := 0;

    end;
            close(solution);
//    READLN;
end.



