#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n), pos(n + 1);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] > 0) {
      pos[i + 1] = 1;
    }
  }
  int cnt = 0;
  int cur = 0;
  long long ansp = 0, ansn = 0;
  for (int i = 1; i <= n; i++) {
    int neg = 1 - pos[i];
    cur = (neg + cur) % 2;
    if (cur) {
      ansp += cnt;
      ansn += (i - cnt);
    } else {
      ansp += (i - cnt);
      ansn += cnt;
    }
    cnt += cur;
  }
  cout << ansn << " " << ansp << '\n';
}
