k;=0;
for i:=1 to N do
if a[i]< ((Max-Min)/2) then
begin
a[i]:=0;
inc(k);
end;
var
arr: array[1..100] of Integer;
k,n,max,min,i: Integer;
begin
k:=0;
writeln('Enter a size of array:');
readln(n);
for i:=1 to n do readln(arr[i]);
min:=arr[1]; max:=arr[1];
for i:=1 to n do if (arr[i]>max) then
max:=arr[i] else if (arr[i]<min) then
min:=arr[i];
for i:=1 to n do
if arr[i] < ((Max-Min)/2) then
begin
arr[i]:=0;
inc(k);
end;
writeln(k);
readln
end.