program NumberOfDifferences;
var sum, a, b: integer;
begin
sum := 0;
readln(a);
b := a;
while a <> 0 do begin
if ((a < 0) and (b > 0)) or ((a > 0) and (b < 0)) then
sum := sum + 1;
end;
writeln(sum);
end.
program NumberOfDifferences;
var sum, a, b: integer;
begin
sum := 0;
readln(a);
b := a;
while a <> 0 do begin
readln(a);
if ((a < 0) and (b > 0)) or ((a > 0) and (b < 0)) then
sum := sum + 1;
b := a;
end;
writeln(sum);
end.