#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int inf = 1e9;
const long long INF = 1e18;
const int mn = 2e5 + 10;
const int mm = 1e6 + 10;
int a[mn];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  int cnt = 0;
  long long ans = 0;
  int ji = 0, ou = 0, jipos = 0, oupos = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] < 0) {
      cnt++;
      if (cnt % 2 == 1) {
        ji += i - oupos;
        jipos = i;
      } else {
        ou += i - jipos;
        oupos = i;
      }
    }
    if (cnt % 2 == 1)
      ans += (long long)ji;
    else
      ans += (long long)ou;
  }
  long long temp = (long long)n * (n + 1) / 2;
  printf("%lld %lld\n", ans, temp - ans);
  return 0;
}
