import java.util.*;
public class Main{
static int N=200010;
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
long rp=0;long rn=0;
int sp=1;
int sn=0;
int s=1;
while(n-->0){
int a=sc.nextInt();
if(a<0)s*=-1;
if(s>0){
rp+=sp;
rn+=sn;
sp++;
}else{
rp+=sn;
rn+=sp;
sn++;
}
}
System.out.println(rn+" "+rp);
}
}