function processData(input) { let s = input.split("\n"); let length = s[0]; let data = s[1];let seaLevel=0; let aboweSeaLevel=true; let valley=0; for(let i=0;i=0 && !aboweSeaLevel) aboweSeaLevel=true; } console.log(valley); } process.stdin.resume(); process.stdin.setEncoding("ascii"); _input = ""; process.stdin.on("data", function (input) { _input += input; }); process.stdin.on("end", function () { processData(_input); });