#include <bits/stdc++.h>
using namespace std;
int n, a;
int main() {
  long long ans1 = 0, ans2 = 0, sum1 = 0, sum2 = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a);
    if (a > 0) {
      ans1++;
    } else {
      swap(ans1, ans2);
      ans2++;
    }
    sum1 += ans1;
    sum2 += ans2;
  }
  cout << sum2 << " " << sum1;
}
