#include <iostream>
using namespace std;
typedef long long LL;
const int N=2e5+5;
int a[N];
int s[N];
int n;
LL num1,num2;
int main()
{
cin>>n;
s[0]=1;
num1++;
for(int i=1;i<=n;i++){
cin>>a[i];
s[i]=s[i-1]*(a[i]>0?1:-1);
if(s[i]>0)
num1++;
else num2++;
//cout<<s[i];
}
//组合数 前缀和一正一负,序列乘积为负
cout<<num2*num1<<" "<<num2*(num2-1)/2+num1*(num1-1)/2;
//cout << "Hello world!" << endl;
return 0;
}