#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 7;
int sum[N];
int main() {
  int n, x;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    sum[i] = sum[i - 1] + (x < 0);
  }
  long long ans1 = 0, ans2 = 0;
  int ji = 0, ou = 1;
  for (int i = 1; i <= n; i++) {
    if (sum[i] % 2) {
      ans1 += ji;
      ans2 += ou;
      ji++;
    } else {
      ans1 += ou;
      ans2 += ji;
      ou++;
    }
  }
  printf("%lld %lld\n", ans2, ans1);
  return 0;
}
