#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> arr(n); for(int i = 0; i < n; i++) cin >> arr[i]; vector<int> postive(n,0),negative(n,0); postive[0] = arr[0] > 0 ? 1 : 0; negative[0] = arr[0] > 0 ? 0 : 1; int ret = 0; for(int i = 1; i < n; i++){ if(arr[i] > 0){ postive[i] = postive[i-1] + 1; negative[i] = (negative[i-1] == 0 ? 0 : negative[i-1] + 1); }else if(arr[i] < 0) { negative[i] = postive[i-1] + 1; postive[i] = (negative[i-1] == 0 ? 0 : negative[i-1] + 1); }else { negative[i] = 0; postive[i] = 0; } if(ret < postive[i]) ret = postive[i]; } cout << ret << endl; return 0; } // 64 位输出请用 printf("%lld")