function Main(input) {
	input = input.trim();
  var len = parseInt(input.split("\n")[0]);
  var list = input.split("\n")[1].split(" ").map((list)=>Number(list));
  var max = Math.max.apply(null,list);//最大値。
  var count = 0;
  var lastCount = 0;
  var mae = 0;
  for(var i = len - 1; i >= 0; i--){
    var tmp = list[i];
    //console.log(tmp);
    if(i == len - 1){
       count++;
      mae = tmp;
       continue;
    }
    if(tmp < mae){
       lastCount = Math.max(lastCount, count);
      count = 0;
    }else{
      count++;
    }
    mae = list[i];
  }
  console.log(lastCount - 1);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
