const
  maxn = 300000;
var
  a : array[1..maxn] of integer;
  ans : array[1..maxn] of boolean;
  good : boolean;
  n, i, cnt, j, max : integer;
begin
  assign(input, 'cubics.in');
  assign(output, 'cubics.out');
  reset(input);
  rewrite(output);
  read(n);
  for i := 1 to n do begin
    read(a[i]);
  end;
  max := 0;
  cnt := 0;
  for i := 1 to n - 1 do begin
    if (a[i] > max) then
      max := a[i];
    good := true;
    for j := i + 1 to n do begin
      if (a[j] < max) then begin
        good := false;
        break;
      end;
    end;
    if (good) then begin
      cnt := cnt + 1;
      ans[i] := true;
    end;
  end;

  writeln(cnt);
  for i := 1 to n - 1 do begin
    if (ans[i]) then
      write(i, ' ');
  end;
end.
